1"use strict";(self.webpackChunkfirestore_eloquent=self.webpackChunkfirestore_eloquent||[]).push([[9483],{6026:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>c});var i=n(5893),s=n(1151);const o={sidebar_position:2},r="Configuration",d={id:"get-started/configuration",title:"Configuration",description:"All configuration settings can be found in the firebase.php file, which is located in the config directory under `config/firebase.php`.",source:"@site/docs/get-started/configuration.mdx",sourceDirName:"get-started",slug:"/get-started/configuration",permalink:"/docs/get-started/configuration",draft:!1,unlisted:!1,editUrl:"https://github.com/FreddyWhest/firestore-eloquent-docs/tree/main/docs/get-started/configuration.mdx",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Installation",permalink:"/docs/get-started/installation"},next:{title:"Guides",permalink:"/docs/category/guides"}},l={},c=[{value:"Guest Url",id:"guest-url",level:2},{value:"Auth Url",id:"auth-url",level:2},{value:"Auth Model",id:"auth-model",level:2},{value:"Class Namespace",id:"class-namespace",level:2},{value:"Firebase/Firestore Project Id",id:"firebasefirestore-project-id",level:2}];function a(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"configuration",children:"Configuration"}),"\n",(0,i.jsxs)(t.p,{children:["All configuration settings can be found in the ",(0,i.jsx)(t.strong,{children:"firebase.php"})," file, which is located in the config directory under ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"config/firebase.php"})}),"."]}),"\n",(0,i.jsxs)(t.admonition,{title:"IMPORTANT",type:"info",children:[(0,i.jsx)(t.p,{children:"If the file does not exists, you need to run the following artisan command:"}),(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'php artisan vendor:publish --provider="Roddy\\FirestoreEloquent\\Providers\\FModelProvider" --force\n'})})]}),"\n",(0,i.jsx)(t.h2,{id:"guest-url",children:"Guest Url"}),"\n",(0,i.jsxs)(t.p,{children:["To modify the URL to which a user is redirected when attempting to access routes with the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"f.guest"})})," middleware after logging in, navigate to the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"config/firebase.php"})})," file and update the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"guest_url"})})," value. The default setting is ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"home"})}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"auth-url",children:"Auth Url"}),"\n",(0,i.jsxs)(t.p,{children:["To modify the URL to which a user is redirected when attempting to access routes with the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"f.auth"})})," middleware after logging out, navigate to the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"config/firebase.php"})})," file and update the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"auth_url"})})," value. The default setting is ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"login"})}),"."]}),"\n",(0,i.jsx)(t.h2,{id:"auth-model",children:"Auth Model"}),"\n",(0,i.jsxs)(t.p,{children:["To modify the model used for authentication, navigate to the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"config/firebase.php"})})," file and update the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"auth_model"})})," value. The default setting is ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"App\\\\FModels\\\\User"})}),". Adjust it to the appropriate model for authentication."]}),"\n",(0,i.jsxs)(t.admonition,{title:"IMPORTANT",type:"info",children:[(0,i.jsx)(t.p,{children:"Ensure that the specified model exists, or you can create it using the following artisan command:"}),(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"php artisan make:fmodel User\n"})}),(0,i.jsxs)(t.p,{children:["See more about ",(0,i.jsx)(t.a,{href:"/docs/guide/artisan-command",children:"FModels Artisan Commands"}),"."]})]}),"\n",(0,i.jsx)(t.h2,{id:"class-namespace",children:"Class Namespace"}),"\n",(0,i.jsxs)(t.p,{children:["To alter the location or class namespace for the creation of models, navigate to the ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"config/firebase.php"})})," file and modify the ",(0,i.jsx)(t.code,{children:"class_namespace"})," to the desired namespace or location."]}),"\n",(0,i.jsxs)(t.admonition,{title:"NOTE",type:"note",children:[(0,i.jsxs)(t.p,{children:["Note that models are generated in the location based on the specified namespace provided. For example, if the namespace is set to ",(0,i.jsx)(t.code,{children:"App\\\\FModels\\\\"}),", the models will be created in the ",(0,i.jsx)(t.code,{children:"app/FModels"})," directory."]}),(0,i.jsxs)(t.p,{children:["The default setting is ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.code,{children:"App\\\\FModels"})}),"."]})]}),"\n",(0,i.jsx)(t.h2,{id:"firebasefirestore-project-id",children:"Firebase/Firestore Project Id"}),"\n",(0,i.jsx)(t.p,{children:"To obtain the Firebase Project Id, you need to follow these steps:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["Go to the ",(0,i.jsx)(t.a,{href:"https://console.firebase.google.com/",children:"Firebase Console"})," and select your project."]}),"\n",(0,i.jsxs)(t.li,{children:["Click on the ",(0,i.jsx)(t.strong,{children:"Project Overview"})," button."]}),"\n",(0,i.jsxs)(t.li,{children:["Click on the ",(0,i.jsx)(t.strong,{children:"Settings"})," button and select ",(0,i.jsx)(t.strong,{children:"Project Settings"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:["Copy the ",(0,i.jsx)(t.strong,{children:"Project ID"}),"."]}),"\n",(0,i.jsx)(t.li,{children:"Update .env File with the following:"}),"\n"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["Open your .env file and add the following line, replacing ",(0,i.jsx)(t.code,{children:"your-project-id"})," with the correct project id:"]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-dotenv",children:"FIREBASE_PROJECT_ID=your-project-id\n"})}),"\n",(0,i.jsx)(t.p,{children:"The Project ID is a unique identifier for your Firebase project. You can use this Project ID when configuring Firebase services or integrating Firebase with other platforms."})]})}function h(e={}){const{wrapper:t}={...(0,s.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},1151:(e,t,n)=>{n.d(t,{Z:()=>d,a:()=>r});var i=n(7294);const s={},o=i.createContext(s);function r(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(o.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.