PageSourceSearch

https://firestore-eloquent.netlify.app/assets/js/05b6dfe1.0fd4039d.js

js firestore-eloquent.netlify.app collected 2026-10-03 10:45:20 UTC 10,731 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkfirestore_eloquent=self.webpackChunkfirestore_eloquent||[]).push([[7259],{5324:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>a});var t=i(5893),s=i(1151);const r={sidebar_position:2},o="Configuration",l={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/versioned_docs/version-2.x/get-started/configuration.mdx",sourceDirName:"get-started",slug:"/get-started/configuration",permalink:"/docs/2.x/get-started/configuration",draft:!1,unlisted:!1,editUrl:"https://github.com/FreddyWhest/firestore-eloquent-docs/tree/main/versioned_docs/version-2.x/get-started/configuration.mdx",tags:[],version:"2.x",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Installation",permalink:"/docs/2.x/get-started/installation"},next:{title:"Guides",permalink:"/docs/2.x/category/guides"}},c={},a=[{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 Credentials",id:"firebase-credentials",level:2},{value:"Firebase Project Id",id:"firebase-project-id",level:2},{value:"Firebase Database Url",id:"firebase-database-url",level:2}];function d(e){const n={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,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"configuration",children:"Configuration"}),"\n",(0,t.jsxs)(n.p,{children:["All configuration settings can be found in the ",(0,t.jsx)(n.strong,{children:"firebase.php"})," file, which is located in the config directory under ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"config/firebase.php"})}),"."]}),"\n",(0,t.jsxs)(n.admonition,{title:"IMPORTANT",type:"info",children:[(0,t.jsx)(n.p,{children:"If the file does not exists, you need to run the following artisan command:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:'php artisan vendor:publish --provider="Kreait\\Laravel\\Firebase\\ServiceProvider" --tag=config\n'})})]}),"\n",(0,t.jsx)(n.h2,{id:"guest-url",children:"Guest Url"}),"\n",(0,t.jsxs)(n.p,{children:["To modify the URL to which a user is redirected when attempting to access routes with the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"f.guest"})})," middleware after logging in, navigate to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"config/firebase.php"})})," file and update the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"guest_url"})})," value. The default setting is ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"home"})}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"auth-url",children:"Auth Url"}),"\n",(0,t.jsxs)(n.p,{children:["To modify the URL to which a user is redirected when attempting to access routes with the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"f.auth"})})," middleware after logging out, navigate to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"config/firebase.php"})})," file and update the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"auth_url"})})," value. The default setting is ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"login"})}),"."]}),"\n",(0,t.jsx)(n.h2,{id:"auth-model",children:"Auth Model"}),"\n",(0,t.jsxs)(n.p,{children:["To modify the model used for authentication, navigate to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"config/firebase.php"})})," file and update the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"auth_model"})})," value. The default setting is ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"App\\\\FModels\\\\User"})}),". Adjust it to the appropriate model for authentication."]}),"\n",(0,t.jsxs)(n.admonition,{title:"IMPORTANT",type:"info",children:[(0,t.jsx)(n.p,{children:"Ensure that the specified model exists, or you can create it using the following artisan command:"}),(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"php artisan make:fmodel User\n"})}),(0,t.jsxs)(n.p,{children:["See more about ",(0,t.jsx)(n.a,{href:"/docs/guide/artisan-command",children:"FModels Artisan Commands"}),"."]})]}),"\n",(0,t.jsx)(n.h2,{id:"class-namespace",children:"Class Namespace"}),"\n",(0,t.jsxs)(n.p,{children:["To alter the location or class namespace for the creation of models, navigate to the ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"config/firebase.php"})})," file and modify the ",(0,t.jsx)(n.code,{children:"class_namespace"})," to the desired namespace or location."]}),"\n",(0,t.jsxs)(n.admonition,{title:"NOTE",type:"note",children:[(0,t.jsxs)(n.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,t.jsx)(n.code,{children:"App\\\\FModels\\\\"}),", the models will be created in the ",(0,t.jsx)(n.code,{children:"app/FModels"})," directory."]}),(0,t.jsxs)(n.p,{children:["The default setting is ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"App\\\\FModels"})}),"."]})]}),"\n",(0,t.jsx)(n.h2,{id:"firebase-credentials",children:"Firebase Credentials"}),"\n",(0,t.jsx)(n.p,{children:"To obtain the firebase-credentials.json file for Cloud Firestore and set it up with you project, you need to follow these steps:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to the ",(0,t.jsx)(n.a,{href:"https://console.firebase.google.com/",children:"Firebase Console"})," and create a new project."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Project Overview"})," button."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Settings"})," button and select ",(0,t.jsx)(n.strong,{children:"Project Settings"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Service Accounts"})," tab."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Generate New Private Key"})," button to download the firebase-credentials.json file."]}),"\n",(0,t.jsx)(n.li,{children:"Copy firebase-credentials.json to Your Project."}),"\n",(0,t.jsx)(n.li,{children:"Update .env File with the following"}),"\n"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Open your .env file and add the following line, replacing ",(0,t.jsx)(n.code,{children:"path/to/firebase-credentials.json"})," with the correct path:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-dotenv",children:"FIREBASE_CREDENTIALS=/path/to/firebase-credentials.json\n"})}),"\n",(0,t.jsx)(n.p,{children:"Now your Laravel project is configured to use the Firebase credentials for Cloud Firestore. Make sure to keep the firebase-credentials.json file secure and not expose it publicly."}),"\n",(0,t.jsx)(n.h2,{id:"firebase-project-id",children:"Firebase Project Id"}),"\n",(0,t.jsx)(n.p,{children:"To obtain the Firebase Project Id, you need to follow these steps:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to the ",(0,t.jsx)(n.a,{href:"https://console.firebase.google.com/",children:"Firebase Console"})," and select your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Project Overview"})," button."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Settings"})," button and select ",(0,t.jsx)(n.strong,{children:"Project Settings"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy the ",(0,t.jsx)(n.strong,{children:"Project ID"}),"."]}),"\n",(0,t.jsx)(n.li,{children:"Update .env File with the following:"}),"\n"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Open your .env file and add the following line, replacing ",(0,t.jsx)(n.code,{children:"your-project-id"})," with the correct project id:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-dotenv",children:"FIREBASE_PROJECT_ID=your-project-id\n"})}),"\n",(0,t.jsx)(n.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."}),"\n",(0,t.jsx)(n.h2,{id:"firebase-database-url",children:"Firebase Database Url"}),"\n",(0,t.jsx)(n.p,{children:"To obtain the Firebase Database Url, you need to follow these steps:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["Go to the ",(0,t.jsx)(n.a,{href:"https://console.firebase.google.com/",children:"Firebase Console"})," and select your project."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Project Overview"})," button."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Settings"})," button and select ",(0,t.jsx)(n.strong,{children:"Project Settings"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:["Click on the ",(0,t.jsx)(n.strong,{children:"Service Accounts"})," tab."]}),"\n",(0,t.jsxs)(n.li,{children:["Copy the ",(0,t.jsx)(n.strong,{children:"Database URL"}),". It should look something like this: ",(0,t.jsx)(n.code,{children:"https://<your-project>.firebaseio.com"}),"."]}),"\n",(0,t.jsx)(n.li,{children:"Update .env File with the following:"}),"\n"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Open your .env file and add the following line, replacing ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"https://<your-project>.firebaseio.com"})})," with the correct database url:"]}),"\n"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-dotenv",children:"FIREBASE_DATABASE_URL=https://<your-project>.firebaseio.com\n"})}),"\n",(0,t.jsx)(n.p,{children:"You can copy this URL and use it in your Laravel application's configuration, particularly if you are working with Firebase Realtime Database features."})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>l,a:()=>o});var t=i(7294);const s={},r=t.createContext(s);function o(e){const n=t.useContext(r);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(r.Provider,{value:n},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.