Configure your project
The committed settings that make the kit yours, and the flags that decide which optional features exist.
Settings live in two places. Anything that changes between machines is an environment variable, read from .env and covered in The environment file. Anything that belongs to the product is a committed value in config/ and travels with the repository. This guide covers the committed values a developer changes when a project starts, the environment variables they read, and every feature flag with exactly what it turns off.
Name, home and project key
Key in config/app.php |
Value | What it does |
|---|---|---|
name |
env('APP_NAME', 'Laravel') |
The browser title, the alt text of the logo, and the sender name of mail through MAIL_FROM_NAME="${APP_NAME}". Set APP_NAME in .env. |
home_route |
/app |
Where a person lands after signing in, registering, verifying their email, resetting or confirming a password, opening /home, and where an administrator returns when they stop impersonating. Change it when your authenticated area lives somewhere else. |
project |
weblabor-base |
The folder under docs/ that holds your guides and changelog and the folder under resources/views/landing/ that holds your landing and feature pages. Change it once, when the project starts. See Make it your own. |
Logo and icon
'logo' => 'images/logo.svg',
'icon' => 'images/icon.svg',
Both are paths inside public/, resolved with asset(). The logo is the wide image in the header of the application layout. The icon is the square one: the favicon, the image above the sign-in, registration, verification and password screens, the compact header on small screens, the picture of a notification in the notification centre and in a web push, and the base image php artisan pwa:generate-assets offers when it builds the PWA icons and splash screens. Replace the two files or point the keys at your own.
Administrators and seeded accounts
'sudo' => [
'[email protected]',
],
'default_users' => [
'[email protected]',
],
php artisan db:seed reads both lists. For every email in either list it creates the account when it does not exist yet, including a soft-deleted one:
- The name is the part before
@, in headline case:[email protected]isAdmin. - The email is verified on the spot, so the account signs in without a code.
- The password is the part before
@reversed:[email protected]signs in withnimda.
The sudo list does two more things. The seeder gives each of those accounts the role named in admin_role, and when the password is still the generated one it marks the account so the next sign-in is sent to change it before reaching anything else. The list also defines who is a super-administrator at runtime: $user->sudo is true for any account whose email is on it, which opens the DevZone at /admin/dev, allows reading the activity log, and keeps other administrators from deleting the account. See Sudo and super-administrators.
default_users receives no role and no forced password change. Use it for the test accounts you want on every environment you seed.
The list is committed, so put your own email there before the first seed and keep [email protected] out of production.
Feature flags
config/features.php decides which optional parts of the product exist. Every flag reads an environment variable and defaults to false, so a fresh .env has all of them off. Turn one on by writing the variable:
FEATURE_ANNOUNCEMENTS=true
FEATURE_PLANS_ENABLED=true
FEATURE_ADDONS_ENABLED=true
FEATURE_TRACKING_ENABLED=true
FEATURE_REFERRALS_ENABLED=true
FEATURE_TICKETS_ENABLED=true
FEATURE_TICKETS_CHAT_ENABLED=true
.env.example only lists FEATURE_PLANS_ENABLED, FEATURE_ADDONS_ENABLED, FEATURE_TICKETS_ENABLED and FEATURE_TICKETS_CHAT_ENABLED; add the others yourself.
| Key | Env variable | Off on the public site and the account | Off in the admin panel |
|---|---|---|---|
announcements |
FEATURE_ANNOUNCEMENTS |
The megaphone dropdown leaves the header, the Announcements entry leaves the account sidebar, and /account/announcements and each announcement page answer 404. |
The Announcements resource leaves the menu and its pages answer 403: its policy denies every action. |
plans_enabled |
FEATURE_PLANS_ENABLED |
"My plans" leaves the account sidebar and /account/plans answers 403. The subscription check on /app lets everyone through, since no plan is active. Free-plan auto-subscription at registration does nothing. |
The Plans resource leaves the menu, billing metrics leave the dashboard, and the daily exchange-rate sync is not scheduled unless add-ons are on. The resource also needs STRIPE_SECRET to appear. |
addons_enabled |
FEATURE_ADDONS_ENABLED |
/account/add-ons and every add-on detail page answer 404, and the add-on catalogue is not offered on the plans page. |
The Add-ons resource leaves the menu and its pages answer 403. |
tracking_enabled |
FEATURE_TRACKING_ENABLED |
Nothing visible changes. No tracking session is created for a visit, every trackingEvent() call is ignored, and nothing is sent to the Facebook Conversions API even when FACEBOOK_ACCESS_TOKEN and FACEBOOK_PIXEL_ID are set. |
Tracking Event Types, Tracking Sessions and Tracking Events leave the menu and answer 403, the two tracking tabs leave the detail of a user, and "Tracking Events" leaves the dashboard metrics. |
referrals.enabled |
FEATURE_REFERRALS_ENABLED |
The Referrals entry leaves the account sidebar and /account/referrals answers 404. A ?referrer=CODE in a URL is ignored, no referral is recorded at registration and no reward is ever created. |
"Referral Subscriptions" leaves the dashboard metrics. There is no admin resource for referrals. |
tickets.enabled |
FEATURE_TICKETS_ENABLED |
The Support entry leaves the account sidebar, every ticket page answers 404 and the Technical support help guides are hidden. Tickets already stored are kept. | The Support inbox entry leaves the sidebar and answers 404, the Answer Ticket permission leaves the role editor, the Priority support switch leaves the plan form, and the scheduled ticket commands do nothing. See Support tickets. |
tickets.chat.enabled |
FEATURE_TICKETS_CHAT_ENABLED |
Works only with tickets on and real time running. Off, the user sees only the tickets and every chat page answers 404. | The Chats entry leaves the support sidebar. See Live support chat. |
The admin menu hides a resource when its policy denies viewAny, and every policy above denies everything while its flag is off. That is why a section you cannot see also cannot be reached by typing its URL.
The referral sub-keys
The referrals array carries the program's numbers as well as its switch. See Referrals for the flow.
| Key | Env variable | Default | What it does |
|---|---|---|---|
referrals.enabled |
FEATURE_REFERRALS_ENABLED |
false |
The switch described above. |
referrals.registration_reward |
FEATURE_REFERRALS_REGISTRATION_REWARD |
10 |
Amount credited to the referrer when a referred person registers. 0 creates no registration reward. |
referrals.subscription_reward_percent |
FEATURE_REFERRALS_SUBSCRIPTION_REWARD_PERCENT |
10 |
Percentage of every paid subscription invoice of a referred person credited to the referrer. 0 creates no subscription reward. |
referrals.currency |
FEATURE_REFERRALS_CURRENCY |
mxn |
Currency of the registration reward, and of a subscription reward when the Stripe invoice carries no currency. Lower-case ISO code. |
referrals.cookie_days |
FEATURE_REFERRALS_COOKIE_DAYS |
30 |
Days the referrer code stays in the visitor's cookie after they arrive with ?referrer=CODE. Values under 1 are read as 1. |
The deployment trap
Because every flag defaults to off, a section that works on your machine and is missing on the server is almost always a variable that was never written to the server's .env. The symptom is silent: no error, the menu entry is simply not there. Write the flags on the server too, and clear the configuration cache after changing them. See Deploy your project.
The rest of config/app.php
| Key | Value | What it does |
|---|---|---|
timezone |
UTC |
The timezone dates are stored in, and the one a visitor without an account sees. Leave it at UTC; each account has its own. See Timezones and dates. |
locale |
env('APP_LOCALE', 'es') |
The language outside a web request: console commands, queued jobs and API routes. Web requests resolve their own language and never read it. |
languages |
['es' => 'Spanish', 'en' => 'English'] |
The languages a visitor can switch to and an account can choose. |
fallback_locale |
es |
The language when nothing else decides, and the one a missing translation falls back to. See Languages and translations. |
pwa |
env('APP_PWA', false) |
Turns on the service worker and the PWA behaviour. See Web push and the PWA. |
country_code_fallback |
env('COUNTRY_CODE_FALLBACK', 'US') |
The country assumed when the visitor's IP is private, which is every request in local development. See Detect the visitor's country. |
The permission keys decide what php artisan db:seed generates for the admin panel. The full flow is in Roles and permissions.
| Key | Default | What it does |
|---|---|---|
discover_front_permissions |
true |
Generates create, retrieve, update and delete permissions for every admin resource that has a model. |
allow_permisisons_deletion |
true |
Soft-deletes permissions that are no longer generated or listed. The key is spelled exactly like this in the file and in the seeder. |
permissions |
[] |
Extra permissions as 'permission name' => 'web'. |
admin_role |
admin |
The role that receives every permission and is assigned to the sudo accounts. |
default_role |
null |
A role created at seed time for ordinary users, for example 'default'. null creates none. |
default_role_permissions |
[] |
Permissions given to default_role the first time it is created. |
The committed values of config/pricing.php
These matter once FEATURE_PLANS_ENABLED or FEATURE_ADDONS_ENABLED is on. How to use them is in Create and price a plan and Free trials and coupons.
| Key | Env variable | Default | What it does |
|---|---|---|---|
primary_currency |
none | mxn |
The currency revenue is converted to on the admin dashboard and the base of the daily exchange-rate snapshots. Change it in the file. |
exchange_rates.provider |
none | frankfurter |
The rate provider. frankfurter is the only one the kit implements. |
exchange_rates.endpoint |
none | https://api.frankfurter.app |
Where rates are fetched from. |
exchange_rates.timeout |
none | 10 |
Seconds to wait for the provider. |
coupons.enabled |
BILLING_COUPONS_ENABLED |
true |
Shows the promotion code field on Stripe Checkout. Codes are created in the Stripe dashboard. |
freeTrial.enabled |
BILLING_FREE_TRIAL_ENABLED |
false |
Gives every new subscription a trial. |
freeTrial.days |
BILLING_FREE_TRIAL_DAYS |
14 |
Length of that trial. |
intervals |
none | monthly, yearly |
The billing frequencies a price can have. Each entry has interval (month or year), label, count (intervals per cycle) and active. Adding one adds a column to the admin pricing form. |
Rates are fetched by php artisan billing:sync-exchange-rates, scheduled daily at 12:00 while plans or add-ons are enabled, for the dates that had a paid subscription in a currency other than the primary one.