The
config
function gets the value of a configuration variable. The configuration values may be accessed using "dot" syntax, which includes the name of the file and the option you wish to access. A default value may be specified and is returned if the configuration option does not exist:<?php $value = config('app.timezone');
$value = config('app.timezone', $default);
<?php 'sites' => [
'default' => [
'name' => config('app.name'),
'locale' => 'en_US',
'url' => '/',
],
<?php 'passwords' => [
'resets' => config('auth.defaults.passwords'),
'activations' => config('auth.defaults.passwords'),
],
<?php 'passwords' => [
'resets' => config('auth.defaults.passwords'),
'activations' => config('auth.defaults.passwords'),
],
<?php |
'database' => config('database.default'),
'tables' => [
'users' => 'users',
<?php Route::get('utilities', 'Utilities\UtilitiesController@index')->name('utilities.index');
Utility::routes();
if (config('statamic.graphql.enabled')) {
Route::get('graphql', 'GraphQLController@index')->name('graphql.index');
Route::get('graphiql', 'GraphQLController@graphiql')->name('graphql.graphiql');
}
<?php use Statamic\Http\Middleware\CP\SwapExceptionHandler as SwapCpExceptionHandler;
use Statamic\Http\Middleware\RequireStatamicPro;
if (config('statamic.api.enabled')) {
Route::middleware([
SwapApiExceptionHandler::class,
RequireStatamicPro::class,
<?php RequireStatamicPro::class,
Cache::class,
])->group(function () {
Route::middleware(config('statamic.api.middleware'))
->name('statamic.api.')
->prefix(config('statamic.api.route'))
->namespace('Statamic\Http\Controllers\API')
<?php ])->group(function () {
Route::middleware(config('statamic.api.middleware'))
->name('statamic.api.')
->prefix(config('statamic.api.route'))
->namespace('Statamic\Http\Controllers\API')
->group(__DIR__.'/api.php');
});
<?php });
}
if (config('statamic.cp.enabled')) {
Route::middleware(SwapCpExceptionHandler::class)->group(function () {
Route::middleware('statamic.cp')
->name('statamic.cp.')
<?php Route::middleware(SwapCpExceptionHandler::class)->group(function () {
Route::middleware('statamic.cp')
->name('statamic.cp.')
->prefix(config('statamic.cp.route'))
->namespace('Statamic\Http\Controllers\CP')
->group(__DIR__.'/cp.php');
});
<?php });
}
Route::middleware(config('statamic.routes.middleware', 'web'))
->namespace('Statamic\Http\Controllers')
->group(__DIR__.'/web.php');
<?php if (! config('statamic.assets.image_manipulation.cache')) {
Site::all()->map(function ($site) {
return URL::makeRelative($site->url());
})->unique()->each(function ($sitePrefix) {
<?php Site::all()->map(function ($site) {
return URL::makeRelative($site->url());
})->unique()->each(function ($sitePrefix) {
Route::group(['prefix' => $sitePrefix.'/'.config('statamic.assets.image_manipulation.route')], function () {
Route::get('/asset/{container}/{path?}', 'GlideController@generateByAsset')->where('path', '.*');
Route::get('/http/{url}/{filename?}', 'GlideController@generateByUrl');
Route::get('{path}', 'GlideController@generateByPath')->where('path', '.*');
<?php });
}
Route::group(['prefix' => config('statamic.routes.action')], function () {
Route::post('forms/{form}', 'FormController@submit')->name('forms.submit');
Route::get('protect/password', '\Statamic\Auth\Protect\Protectors\Password\Controller@show')->name('protect.password.show');
<?php });
if (OAuth::enabled()) {
Route::get(config('statamic.oauth.routes.login'), 'OAuthController@redirectToProvider')->name('oauth.login');
Route::get(config('statamic.oauth.routes.callback'), 'OAuthController@handleProviderCallback')->name('oauth.callback');
}
});