Configuration
All configuration settings can be found in the firebase.php file, which is located in the config directory under config/firebase.php
.
If the file does not exists, you need to run the following artisan command:
php artisan vendor:publish --provider="Roddy\FirestoreEloquent\Providers\FModelProvider" --force
Guest Url
To modify the URL to which a user is redirected when attempting to access routes with the f.guest
middleware after logging in, navigate to the config/firebase.php
file and update the guest_url
value. The default setting is home
.
Auth Url
To modify the URL to which a user is redirected when attempting to access routes with the f.auth
middleware after logging out, navigate to the config/firebase.php
file and update the auth_url
value. The default setting is login
.
Auth Model
To modify the model used for authentication, navigate to the config/firebase.php
file and update the auth_model
value. The default setting is App\\FModels\\User
. Adjust it to the appropriate model for authentication.
Ensure that the specified model exists, or you can create it using the following artisan command:
php artisan make:fmodel User
See more about FModels Artisan Commands.
Class Namespace
To alter the location or class namespace for the creation of models, navigate to the config/firebase.php
file and modify the class_namespace
to the desired namespace or location.
Note that models are generated in the location based on the specified namespace provided. For example, if the namespace is set to App\\FModels\\
, the models will be created in the app/FModels
directory.
The default setting is App\\FModels
.
Firebase/Firestore Project Id
To obtain the Firebase Project Id, you need to follow these steps:
- Go to the Firebase Console and select your project.
- Click on the Project Overview button.
- Click on the Settings button and select Project Settings.
- Copy the Project ID.
- Update .env File with the following:
- Open your .env file and add the following line, replacing
your-project-id
with the correct project id:
FIREBASE_PROJECT_ID=your-project-id
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.