├── .editorconfig ├── .env.example ├── .env.testing.example ├── .gitattributes ├── .gitignore ├── .gitignore-docker ├── .php-cs-fixer.dist.php ├── Makefile ├── README.md ├── app ├── Console │ ├── Commands │ │ └── HealthCommand.php │ └── ScheduleHandler.php ├── Exceptions │ └── ExceptionsHandler.php ├── Http │ ├── Controllers │ │ └── Controller.php │ └── Middleware │ │ └── MiddlewareHandler.php ├── Models │ └── User.php └── Providers │ ├── AppServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── providers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── cache.php ├── database.php ├── debugbar.php ├── filesystems.php ├── logging.php ├── mail.php ├── queue.php ├── services.php └── session.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 0001_01_01_000000_create_users_table.php │ ├── 0001_01_01_000001_create_cache_table.php │ └── 0001_01_01_000002_create_jobs_table.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.yml ├── docker ├── config │ ├── mysql │ │ ├── init │ │ │ └── create_database.sql │ │ └── mysql.cnf │ ├── nginx │ │ └── nginx.conf │ └── php │ │ ├── entrypoint-dev.sh │ │ ├── entrypoint-prod.sh │ │ ├── php-fpm.conf │ │ ├── php.ini │ │ ├── supervisord.conf │ │ └── xdebug.ini └── dockerfiles │ ├── mysql │ ├── Dockerfile │ └── Dockerfile.dockerignore │ ├── nginx │ ├── Dockerfile │ └── Dockerfile.dockerignore │ ├── node │ └── Dockerfile │ └── php │ ├── Dockerfile │ └── Dockerfile.dockerignore ├── fixer ├── composer.json └── composer.lock ├── package-lock.json ├── package.json ├── phpstan.neon ├── phpunit.xml ├── public ├── .htaccess ├── build │ ├── assets │ │ ├── app-Dn90H4ES.css │ │ └── app-NZ-VPRWC.js │ └── manifest.json ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js ├── ts │ ├── app.ts │ └── bootstrap.ts └── views │ ├── errors │ ├── 404.blade.php │ └── minimal.blade.php │ └── welcome.blade.php ├── routes ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ ├── private │ │ └── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── tsconfig.json └── vite.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | #DOCKER 2 | DOCKER_USER=os_user 3 | 4 | COMPOSE_PROJECT_NAME=laravel-blank 5 | 6 | APP_PATH_HOST=./ 7 | 8 | APP_PATH=/var/www/app 9 | 10 | APP_WEB_PORT=80 11 | 12 | APP_MYSQL_PORT=3306 13 | MYSQL_ROOT_PASS=12345 14 | 15 | APP_REDIS_PORT=6379 16 | 17 | APP_VITE_PORT=5173 18 | 19 | XDEBUG_IDEKEY=MYIDEKEY 20 | XDEBUG_CLIENT_PORT=9003 21 | 22 | #Laravel 23 | APP_NAME=Laravel 24 | APP_ENV=local 25 | APP_KEY=base64:aL6o/U2e1ziUTXsyTkfzNziH9l4crCISoWMwC8LX4B0= 26 | APP_DEBUG=true 27 | APP_TIMEZONE=Europe/Moscow 28 | APP_URL="http://localhost:${APP_WEB_PORT}" 29 | 30 | APP_LOCALE=en 31 | APP_FALLBACK_LOCALE=en 32 | APP_FAKER_LOCALE=en_EN 33 | 34 | APP_MAINTENANCE_DRIVER=file 35 | APP_MAINTENANCE_STORE=database 36 | 37 | BCRYPT_ROUNDS=12 38 | 39 | LOG_CHANNEL=stack 40 | LOG_STACK=daily 41 | LOG_DEPRECATIONS_CHANNEL=null 42 | LOG_LEVEL=debug 43 | 44 | DB_CONNECTION=mysql 45 | DB_HOST="${COMPOSE_PROJECT_NAME}-db" 46 | DB_PORT=3306 47 | DB_DATABASE=my_database 48 | DB_USERNAME=root 49 | DB_PASSWORD="${MYSQL_ROOT_PASS}" 50 | 51 | SESSION_DRIVER=redis 52 | SESSION_LIFETIME=120 53 | SESSION_ENCRYPT=false 54 | SESSION_PATH=/ 55 | SESSION_DOMAIN=null 56 | 57 | BROADCAST_CONNECTION=log 58 | QUEUE_CONNECTION=redis 59 | FILESYSTEM_DISK=public 60 | 61 | CACHE_STORE=file 62 | CACHE_PREFIX= 63 | 64 | REDIS_CLIENT=phpredis 65 | REDIS_HOST="${COMPOSE_PROJECT_NAME}-redis" 66 | REDIS_PASSWORD=null 67 | REDIS_PORT=6379 68 | 69 | MAIL_MAILER=log 70 | MAIL_HOST=127.0.0.1 71 | MAIL_PORT=2525 72 | MAIL_USERNAME=null 73 | MAIL_PASSWORD=null 74 | MAIL_ENCRYPTION=null 75 | MAIL_FROM_ADDRESS="hello@example.com" 76 | MAIL_FROM_NAME="${APP_NAME}" 77 | 78 | AWS_ACCESS_KEY_ID= 79 | AWS_SECRET_ACCESS_KEY= 80 | AWS_DEFAULT_REGION=us-east-1 81 | AWS_BUCKET= 82 | AWS_USE_PATH_STYLE_ENDPOINT=false 83 | 84 | VITE_APP_NAME="${APP_NAME}" -------------------------------------------------------------------------------- /.env.testing.example: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=laravel-blank 2 | 3 | APP_NAME=App 4 | APP_ENV=testing 5 | APP_KEY=base64:XCPrsF+U8VYa6qN0halPXgOGDkJjgrJJlyxirgiGXQ0= 6 | APP_DEBUG=true 7 | APP_TIMEZONE=UTC 8 | APP_URL=http://localhost 9 | 10 | DB_CONNECTION=mysql 11 | DB_HOST="${COMPOSE_PROJECT_NAME}-db" 12 | DB_PORT=3306 13 | DB_DATABASE=my_database_test 14 | DB_USERNAME=root 15 | DB_PASSWORD=12345 -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.phpunit.cache 2 | /node_modules 3 | /public/hot 4 | /public/storage 5 | /storage/*.key 6 | /storage/pail 7 | /vendor 8 | /fixer/vendor 9 | .env 10 | .env.backup 11 | .env.production 12 | .env.testing 13 | .phpactor.json 14 | .phpunit.result.cache 15 | Homestead.json 16 | Homestead.yaml 17 | auth.json 18 | npm-debug.log 19 | yarn-error.log 20 | /.fleet 21 | /.idea 22 | /.nova 23 | /.vscode 24 | /.zed 25 | .php-cs-fixer.cache 26 | -------------------------------------------------------------------------------- /.gitignore-docker: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/build 3 | /public/hot 4 | /public/storage 5 | /storage/*.key 6 | /vendor 7 | .env.backup 8 | .phpunit.result.cache 9 | Homestead.json 10 | Homestead.yaml 11 | auth.json 12 | npm-debug.log 13 | yarn-error.log 14 | /.idea 15 | /.vscode 16 | .env 17 | #docker 18 | /docker/volumes/nginx 19 | /docker/volumes/mysql 20 | /docker/volumes/redis 21 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | in([ 5 | __DIR__ . '/app', 6 | __DIR__ . '/tests', 7 | ]) 8 | ->name('*.php') 9 | ->notName('*.blade.php') 10 | ->ignoreDotFiles(true) 11 | ->ignoreVCS(true); 12 | 13 | return (new PhpCsFixer\Config()) 14 | ->setRules([ 15 | '@PSR12' => true, 16 | 'array_syntax' => ['syntax' => 'short'], 17 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], 18 | 'no_unused_imports' => true, 19 | 'not_operator_with_successor_space' => true, 20 | 'trailing_comma_in_multiline' => true, 21 | 'phpdoc_scalar' => true, 22 | 'unary_operator_spaces' => true, 23 | 'binary_operator_spaces' => true, 24 | 'blank_line_before_statement' => [ 25 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], 26 | ], 27 | 'phpdoc_single_line_var_spacing' => true, 28 | 'phpdoc_var_without_name' => true, 29 | 'method_argument_space' => [ 30 | 'on_multiline' => 'ensure_fully_multiline', 31 | 'keep_multiple_spaces_after_comma' => true, 32 | ], 33 | 'single_trait_insert_per_statement' => true, 34 | 'concat_space' => [ 35 | 'spacing' => 'one' 36 | ] 37 | ]) 38 | ->setFinder($finder); -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | -include .env 2 | 3 | THIS_FILE := $(lastword $(MAKEFILE_LIST)) 4 | 5 | app := $(COMPOSE_PROJECT_NAME)-php 6 | nginx := $(COMPOSE_PROJECT_NAME)-nginx 7 | mysql := $(COMPOSE_PROJECT_NAME)-mysql 8 | app-npm := npm 9 | path := /var/www/app 10 | 11 | #docker 12 | build: 13 | docker-compose -f docker-compose.yml up --build -d $(c) 14 | @echo "Run command: make install" 15 | @echo "$(APP_URL)" 16 | install: composer-install composer-update migrate npm-install npm-update npm-build test 17 | @echo "$(APP_URL)" 18 | rebuild: 19 | docker-compose up -d --force-recreate --no-deps --build $(r) 20 | rebuild-app: 21 | docker-compose up -d --force-recreate --no-deps --build php 22 | up: 23 | docker-compose -f docker-compose.yml up -d $(c) 24 | @echo "$(APP_URL)" 25 | stop: 26 | docker-compose -f docker-compose.yml stop $(c) 27 | it: 28 | docker exec -it $(to) /bin/bash 29 | it-app: 30 | docker exec -it $(app) /bin/bash 31 | it-nginx: 32 | docker exec -it $(nginx) /bin/bash 33 | it-mysql: 34 | docker exec -it $(mysql) /bin/bash 35 | 36 | migrate: 37 | docker exec $(app) php $(path)/artisan migrate 38 | migrate-rollback: 39 | docker exec $(app) php $(path)/artisan migrate:rollback 40 | migrate-fresh: 41 | docker exec $(app) php $(path)/artisan migrate:fresh --seed 42 | migration: 43 | docker exec $(app) php $(path)/artisan make:migration $(m) 44 | 45 | #composer 46 | composer-install: 47 | docker exec $(app) composer install 48 | composer-update: 49 | docker exec $(app) composer update 50 | composer-du: 51 | docker exec $(app) composer du 52 | test: 53 | docker exec $(app) composer test 54 | analyse: 55 | docker exec $(app) composer analyse 56 | 57 | #npm 58 | npm: 59 | docker-compose run --rm --service-ports $(app-npm) $(c) 60 | npm-install: 61 | docker-compose run --rm --service-ports $(app-npm) install $(c) 62 | npm-update: 63 | docker-compose run --rm --service-ports $(app-npm) update $(c) 64 | npm-build: 65 | docker-compose run --rm --service-ports $(app-npm) run build $(c) 66 | npm-host: 67 | docker-compose run --rm --service-ports $(app-npm) run dev --host $(c) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # Laravel 12 blank project 4 | 5 | --- 6 | | Included | 7 | |------------------| 8 | | ✅ Basic setting | 9 | | ✅ PhpStan | 10 | | ✅ Php CS Fixer | 11 | | ✅ TypeScript | 12 | | ✅ Xdebug | 13 | | ✅ Docker | 14 | | ✅ GitHub actions | 15 | 16 | ## Installation 17 | - Run the git clone command `git clone git@github.com:dev-lnk/laravel-blank.git .`. 18 | - Copy the `.env.example` file and rename it to `.env`, customize the `#Docker` section to your needs. 19 | - Run the command `make build`, and then `make install`. 20 | - Check the application's operation using the link `http://localhost` or `http://localhost:${APP_WEB_PORT}`. 21 | - Run stat analysis and tests using the command `make test`. 22 | 23 | ## About 24 | This is a blank Laravel 12 project set up to get started with development. What the setup includes: 25 | - Configured docker for local development. 26 | - Middleware is configured in a separate file. 27 | ```php 28 | namespace App\Http\Middleware; 29 | 30 | use Illuminate\Foundation\Configuration\Middleware; 31 | 32 | class MiddlewareHandler 33 | { 34 | protected array $aliases = [ 35 | //'auth' => AuthMiddleware::class 36 | ]; 37 | 38 | public function __invoke(Middleware $middleware): Middleware 39 | { 40 | if ($this->aliases) { 41 | $middleware->alias($this->aliases); 42 | } 43 | return $middleware; 44 | } 45 | } 46 | ``` 47 | - Cron jobs are configured in a separate file. 48 | ```php 49 | namespace App\Console; 50 | 51 | use Illuminate\Console\Scheduling\Schedule; 52 | 53 | class ScheduleHandler 54 | { 55 | public function __invoke(Schedule $schedule): void 56 | { 57 | //$schedule->command(HealthCommand::class)->hourly(); 58 | } 59 | } 60 | ``` 61 | - Exception handling is configured in a separate file 62 | ```php 63 | namespace App\Exceptions; 64 | 65 | use Illuminate\Foundation\Configuration\Exceptions; 66 | use Illuminate\Http\JsonResponse; 67 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; 68 | use Illuminate\Http\Request; 69 | 70 | class ExceptionsHandler 71 | { 72 | public function __invoke(Exceptions $exceptions): Exceptions 73 | { 74 | $exceptions->renderable( 75 | function (NotFoundHttpException $e, ?Request $request = null) { 76 | if($request?->is('api/*')) { 77 | return $this->jsonResponse($e->getStatusCode()); 78 | } 79 | return response()->view('errors.404', status: $e->getStatusCode()); 80 | } 81 | ); 82 | 83 | return $exceptions; 84 | } 85 | 86 | private function jsonResponse(int $code): JsonResponse 87 | { 88 | return response()->json([ 89 | 'error' => "HTTP error: $code" 90 | ])->setStatusCode($code); 91 | } 92 | } 93 | ``` 94 | - Configured tests. 95 | ```php 96 | namespace Tests; 97 | 98 | use Illuminate\Foundation\Testing\RefreshDatabase; 99 | use Illuminate\Foundation\Testing\TestCase as BaseTestCase; 100 | use Illuminate\Support\Facades\Artisan; 101 | use Illuminate\Support\Facades\Http; 102 | use Illuminate\Support\Facades\Notification; 103 | 104 | abstract class TestCase extends BaseTestCase 105 | { 106 | use RefreshDatabase; 107 | 108 | protected bool $seed = true; 109 | 110 | protected function setUp(): void 111 | { 112 | parent::setUp(); 113 | 114 | Artisan::call('optimize:clear'); 115 | 116 | Notification::fake(); 117 | 118 | Http::preventStrayRequests(); 119 | 120 | $this->withoutVite(); 121 | } 122 | } 123 | ``` 124 | - Added RouteServiceProvider 125 | ```php 126 | namespace App\Providers; 127 | 128 | use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; 129 | use Illuminate\Support\Facades\Route; 130 | 131 | class RouteServiceProvider extends ServiceProvider 132 | { 133 | public function boot(): void 134 | { 135 | // $this->routes(function () { 136 | // Route::middleware(['web', 'app.auth']) 137 | // ->namespace($this->namespace) 138 | // ->prefix('my') 139 | // ->group(base_path('routes/my.php')); 140 | // }); 141 | } 142 | } 143 | ``` 144 | - Installed and configured phpstan (max level). 145 | - Installed and configured TypeScript, used instead of JavaScript. 146 | 147 | The final `bootstrap/app.php` file looks like this: 148 | 149 | ```php 150 | withMiddleware(new MiddlewareHandler()) 159 | ->withSchedule(new ScheduleHandler()) 160 | ->withExceptions(new ExceptionsHandler()) 161 | ->withRouting( 162 | web: __DIR__.'/../routes/web.php', 163 | commands: __DIR__.'/../routes/console.php', 164 | health: '/up', 165 | ) 166 | ->create(); 167 | ``` 168 | 169 | ## Docker 170 | 171 | ### Images 172 | 173 | - nginx:1.27.3-alpine 174 | - php:8.4.7-fpm (with xdebug) 175 | - mysql:9.3.0 176 | - redis:7.0.11-alpine 177 | - node:23.6.1-alpine3.18 178 | 179 | ### Other 180 | - Many commands to speed up development and work with docker can be found in the `Makefile` 181 | - If you don't need Docker, remove: `/docker`, `docker-compose.yml`, `Makefile`. Convert `.env` to standard Laravel form 182 | - To launch containers with `worker` and `scheduler`, delete comments on the corresponding blocks in `docker-compose.yml` -------------------------------------------------------------------------------- /app/Console/Commands/HealthCommand.php: -------------------------------------------------------------------------------- 1 | info('App is working!'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Console/ScheduleHandler.php: -------------------------------------------------------------------------------- 1 | renderable( 17 | function (NotFoundHttpException $e, ?Request $request = null) { 18 | if ($request?->is('api/*')) { 19 | return $this->jsonResponse($e->getStatusCode()); 20 | } 21 | 22 | return response()->view('errors.404', status: $e->getStatusCode()); 23 | } 24 | ); 25 | 26 | return $exceptions; 27 | } 28 | 29 | private function jsonResponse(int $code): JsonResponse 30 | { 31 | return response()->json([ 32 | 'error' => "HTTP error: $code", 33 | ])->setStatusCode($code); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | */ 12 | protected array $aliases = [ 13 | 14 | ]; 15 | 16 | public function __invoke(Middleware $middleware): Middleware 17 | { 18 | if ($this->aliases) { 19 | $middleware->alias($this->aliases); 20 | } 21 | 22 | return $middleware; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | */ 13 | use HasFactory; 14 | 15 | use Notifiable; 16 | 17 | protected $fillable = [ 18 | 'name', 19 | 'email', 20 | 'password', 21 | ]; 22 | 23 | protected $hidden = [ 24 | 'password', 25 | 'remember_token', 26 | ]; 27 | 28 | protected function casts(): array 29 | { 30 | return [ 31 | 'email_verified_at' => 'datetime', 32 | 'password' => 'hashed', 33 | ]; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | isProduction()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | handleCommand(new ArgvInput); 14 | 15 | exit($status); 16 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | withMiddleware(new MiddlewareHandler()) 10 | ->withSchedule(new ScheduleHandler()) 11 | ->withExceptions(new ExceptionsHandler()) 12 | ->withRouting( 13 | web: __DIR__.'/../routes/web.php', 14 | commands: __DIR__.'/../routes/console.php', 15 | health: '/up', 16 | ) 17 | ->create(); 18 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/providers.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => (bool) env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | the application so that it's available within Artisan commands. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | /* 58 | |-------------------------------------------------------------------------- 59 | | Application Timezone 60 | |-------------------------------------------------------------------------- 61 | | 62 | | Here you may specify the default timezone for your application, which 63 | | will be used by the PHP date and date-time functions. The timezone 64 | | is set to "UTC" by default as it is suitable for most use cases. 65 | | 66 | */ 67 | 68 | 'timezone' => env('APP_TIMEZONE', 'UTC'), 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Application Locale Configuration 73 | |-------------------------------------------------------------------------- 74 | | 75 | | The application locale determines the default locale that will be used 76 | | by Laravel's translation / localization methods. This option can be 77 | | set to any locale for which you plan to have translation strings. 78 | | 79 | */ 80 | 81 | 'locale' => env('APP_LOCALE', 'en'), 82 | 83 | 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), 84 | 85 | 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Encryption Key 90 | |-------------------------------------------------------------------------- 91 | | 92 | | This key is utilized by Laravel's encryption services and should be set 93 | | to a random, 32 character string to ensure that all encrypted values 94 | | are secure. You should do this prior to deploying the application. 95 | | 96 | */ 97 | 98 | 'cipher' => 'AES-256-CBC', 99 | 100 | 'key' => env('APP_KEY'), 101 | 102 | 'previous_keys' => [ 103 | ...array_filter( 104 | explode(',', env('APP_PREVIOUS_KEYS', '')) 105 | ), 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Maintenance Mode Driver 111 | |-------------------------------------------------------------------------- 112 | | 113 | | These configuration options determine the driver used to determine and 114 | | manage Laravel's "maintenance mode" status. The "cache" driver will 115 | | allow maintenance mode to be controlled across multiple machines. 116 | | 117 | | Supported drivers: "file", "cache" 118 | | 119 | */ 120 | 121 | 'maintenance' => [ 122 | 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), 123 | 'store' => env('APP_MAINTENANCE_STORE', 'database'), 124 | ], 125 | 126 | ]; 127 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => env('AUTH_GUARD', 'web'), 18 | 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | which utilizes session storage plus the Eloquent user provider. 29 | | 30 | | All authentication guards have a user provider, which defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | system used by the application. Typically, Eloquent is utilized. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication guards have a user provider, which defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | system used by the application. Typically, Eloquent is utilized. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | providers to represent the model / table. These providers may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => env('AUTH_MODEL', App\Models\User::class), 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | These configuration options specify the behavior of Laravel's password 80 | | reset functionality, including the table utilized for token storage 81 | | and the user provider that is invoked to actually retrieve users. 82 | | 83 | | The expiry time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | | The throttle setting is the number of seconds a user must wait before 88 | | generating more password reset tokens. This prevents the user from 89 | | quickly generating a very large amount of password reset tokens. 90 | | 91 | */ 92 | 93 | 'passwords' => [ 94 | 'users' => [ 95 | 'provider' => 'users', 96 | 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), 97 | 'expire' => 60, 98 | 'throttle' => 60, 99 | ], 100 | ], 101 | 102 | /* 103 | |-------------------------------------------------------------------------- 104 | | Password Confirmation Timeout 105 | |-------------------------------------------------------------------------- 106 | | 107 | | Here you may define the amount of seconds before a password confirmation 108 | | window expires and users are asked to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_STORE', 'database'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "array", "database", "file", "memcached", 30 | | "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'array' => [ 37 | 'driver' => 'array', 38 | 'serialize' => false, 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'connection' => env('DB_CACHE_CONNECTION'), 44 | 'table' => env('DB_CACHE_TABLE', 'cache'), 45 | 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), 46 | 'lock_table' => env('DB_CACHE_LOCK_TABLE'), 47 | ], 48 | 49 | 'file' => [ 50 | 'driver' => 'file', 51 | 'path' => storage_path('framework/cache/data'), 52 | 'lock_path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), 77 | 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | 'octane' => [ 90 | 'driver' => 'octane', 91 | ], 92 | 93 | ], 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Cache Key Prefix 98 | |-------------------------------------------------------------------------- 99 | | 100 | | When utilizing the APC, database, memcached, Redis, and DynamoDB cache 101 | | stores, there might be other applications using the same cache. For 102 | | that reason, you may prefix every cache key to avoid collisions. 103 | | 104 | */ 105 | 106 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 107 | 108 | ]; 109 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'sqlite'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Database Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Below are all of the database connections defined for your application. 27 | | An example configuration is provided for each database system which 28 | | is supported by Laravel. You're free to add / remove connections. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sqlite' => [ 35 | 'driver' => 'sqlite', 36 | 'url' => env('DB_URL'), 37 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 38 | 'prefix' => '', 39 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 40 | 'busy_timeout' => null, 41 | 'journal_mode' => null, 42 | 'synchronous' => null, 43 | ], 44 | 45 | 'mysql' => [ 46 | 'driver' => 'mysql', 47 | 'url' => env('DB_URL'), 48 | 'host' => env('DB_HOST', '127.0.0.1'), 49 | 'port' => env('DB_PORT', '3306'), 50 | 'database' => env('DB_DATABASE', 'laravel'), 51 | 'username' => env('DB_USERNAME', 'root'), 52 | 'password' => env('DB_PASSWORD', ''), 53 | 'unix_socket' => env('DB_SOCKET', ''), 54 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 55 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 56 | 'prefix' => '', 57 | 'prefix_indexes' => true, 58 | 'strict' => true, 59 | 'engine' => null, 60 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 61 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 62 | ]) : [], 63 | ], 64 | 65 | 'mariadb' => [ 66 | 'driver' => 'mariadb', 67 | 'url' => env('DB_URL'), 68 | 'host' => env('DB_HOST', '127.0.0.1'), 69 | 'port' => env('DB_PORT', '3306'), 70 | 'database' => env('DB_DATABASE', 'laravel'), 71 | 'username' => env('DB_USERNAME', 'root'), 72 | 'password' => env('DB_PASSWORD', ''), 73 | 'unix_socket' => env('DB_SOCKET', ''), 74 | 'charset' => env('DB_CHARSET', 'utf8mb4'), 75 | 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 76 | 'prefix' => '', 77 | 'prefix_indexes' => true, 78 | 'strict' => true, 79 | 'engine' => null, 80 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 81 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 82 | ]) : [], 83 | ], 84 | 85 | 'pgsql' => [ 86 | 'driver' => 'pgsql', 87 | 'url' => env('DB_URL'), 88 | 'host' => env('DB_HOST', '127.0.0.1'), 89 | 'port' => env('DB_PORT', '5432'), 90 | 'database' => env('DB_DATABASE', 'laravel'), 91 | 'username' => env('DB_USERNAME', 'root'), 92 | 'password' => env('DB_PASSWORD', ''), 93 | 'charset' => env('DB_CHARSET', 'utf8'), 94 | 'prefix' => '', 95 | 'prefix_indexes' => true, 96 | 'search_path' => 'public', 97 | 'sslmode' => 'prefer', 98 | ], 99 | 100 | 'sqlsrv' => [ 101 | 'driver' => 'sqlsrv', 102 | 'url' => env('DB_URL'), 103 | 'host' => env('DB_HOST', 'localhost'), 104 | 'port' => env('DB_PORT', '1433'), 105 | 'database' => env('DB_DATABASE', 'laravel'), 106 | 'username' => env('DB_USERNAME', 'root'), 107 | 'password' => env('DB_PASSWORD', ''), 108 | 'charset' => env('DB_CHARSET', 'utf8'), 109 | 'prefix' => '', 110 | 'prefix_indexes' => true, 111 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 112 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 113 | ], 114 | 115 | ], 116 | 117 | /* 118 | |-------------------------------------------------------------------------- 119 | | Migration Repository Table 120 | |-------------------------------------------------------------------------- 121 | | 122 | | This table keeps track of all the migrations that have already run for 123 | | your application. Using this information, we can determine which of 124 | | the migrations on disk haven't actually been run on the database. 125 | | 126 | */ 127 | 128 | 'migrations' => [ 129 | 'table' => 'migrations', 130 | 'update_date_on_publish' => true, 131 | ], 132 | 133 | /* 134 | |-------------------------------------------------------------------------- 135 | | Redis Databases 136 | |-------------------------------------------------------------------------- 137 | | 138 | | Redis is an open source, fast, and advanced key-value store that also 139 | | provides a richer body of commands than a typical key-value system 140 | | such as Memcached. You may define your connection settings here. 141 | | 142 | */ 143 | 144 | 'redis' => [ 145 | 146 | 'client' => env('REDIS_CLIENT', 'phpredis'), 147 | 148 | 'options' => [ 149 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 150 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 151 | ], 152 | 153 | 'default' => [ 154 | 'url' => env('REDIS_URL'), 155 | 'host' => env('REDIS_HOST', '127.0.0.1'), 156 | 'username' => env('REDIS_USERNAME'), 157 | 'password' => env('REDIS_PASSWORD'), 158 | 'port' => env('REDIS_PORT', '6379'), 159 | 'database' => env('REDIS_DB', '0'), 160 | ], 161 | 162 | 'cache' => [ 163 | 'url' => env('REDIS_URL'), 164 | 'host' => env('REDIS_HOST', '127.0.0.1'), 165 | 'username' => env('REDIS_USERNAME'), 166 | 'password' => env('REDIS_PASSWORD'), 167 | 'port' => env('REDIS_PORT', '6379'), 168 | 'database' => env('REDIS_CACHE_DB', '1'), 169 | ], 170 | 171 | ], 172 | 173 | ]; 174 | -------------------------------------------------------------------------------- /config/debugbar.php: -------------------------------------------------------------------------------- 1 | env('DEBUGBAR_ENABLED', null), 18 | 'hide_empty_tabs' => true, // Hide tabs until they have content 19 | 'except' => [ 20 | 'telescope*', 21 | 'horizon*', 22 | ], 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Storage settings 27 | |-------------------------------------------------------------------------- 28 | | 29 | | Debugbar stores data for session/ajax requests. 30 | | You can disable this, so the debugbar stores data in headers/session, 31 | | but this can cause problems with large data collectors. 32 | | By default, file storage (in the storage folder) is used. Redis and PDO 33 | | can also be used. For PDO, run the package migrations first. 34 | | 35 | | Warning: Enabling storage.open will allow everyone to access previous 36 | | request, do not enable open storage in publicly available environments! 37 | | Specify a callback if you want to limit based on IP or authentication. 38 | | Leaving it to null will allow localhost only. 39 | */ 40 | 'storage' => [ 41 | 'enabled' => true, 42 | 'open' => env('DEBUGBAR_OPEN_STORAGE'), // bool/callback. 43 | 'driver' => 'file', // redis, file, pdo, socket, custom 44 | 'path' => storage_path('debugbar'), // For file driver 45 | 'connection' => null, // Leave null for default connection (Redis/PDO) 46 | 'provider' => '', // Instance of StorageInterface for custom driver 47 | 'hostname' => '127.0.0.1', // Hostname to use with the "socket" driver 48 | 'port' => 2304, // Port to use with the "socket" driver 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Editor 54 | |-------------------------------------------------------------------------- 55 | | 56 | | Choose your preferred editor to use when clicking file name. 57 | | 58 | | Supported: "phpstorm", "vscode", "vscode-insiders", "vscode-remote", 59 | | "vscode-insiders-remote", "vscodium", "textmate", "emacs", 60 | | "sublime", "atom", "nova", "macvim", "idea", "netbeans", 61 | | "xdebug", "espresso" 62 | | 63 | */ 64 | 65 | 'editor' => env('DEBUGBAR_EDITOR') ?: env('IGNITION_EDITOR', 'phpstorm'), 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Remote Path Mapping 70 | |-------------------------------------------------------------------------- 71 | | 72 | | If you are using a remote dev server, like Laravel Homestead, Docker, or 73 | | even a remote VPS, it will be necessary to specify your path mapping. 74 | | 75 | | Leaving one, or both of these, empty or null will not trigger the remote 76 | | URL changes and Debugbar will treat your editor links as local files. 77 | | 78 | | "remote_sites_path" is an absolute base path for your sites or projects 79 | | in Homestead, Vagrant, Docker, or another remote development server. 80 | | 81 | | Example value: "/home/vagrant/Code" 82 | | 83 | | "local_sites_path" is an absolute base path for your sites or projects 84 | | on your local computer where your IDE or code editor is running on. 85 | | 86 | | Example values: "/Users/