├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ ├── Commands │ │ └── BenchmarkCommand.php │ └── Kernel.php ├── Enums │ ├── EndpointEnum.php │ └── ServerEnum.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php ├── Models │ └── User.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php └── Services │ └── HttpService.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── octane.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_reset_tokens_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ └── 2019_12_14_000001_create_personal_access_tokens_table.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.yml ├── frankenphp.Dockerfile ├── json.lua ├── openswoole.Dockerfile ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ └── welcome.blade.php ├── roadrunner.Dockerfile ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── benchmark │ ├── franken-php-health-check-statistics.json │ ├── franken-php-health-check-wrk.json │ ├── franken-php-health-check-wrk.md │ ├── franken-php-http-request-statistics.json │ ├── franken-php-http-request-wrk.json │ ├── franken-php-http-request-wrk.md │ ├── franken-php-static-statistics.json │ ├── franken-php-static-wrk.json │ ├── franken-php-static-wrk.md │ ├── open-swoole-health-check-statistics.json │ ├── open-swoole-health-check-wrk.json │ ├── open-swoole-health-check-wrk.md │ ├── open-swoole-http-request-statistics.json │ ├── open-swoole-http-request-wrk.json │ ├── open-swoole-http-request-wrk.md │ ├── open-swoole-static-statistics.json │ ├── open-swoole-static-wrk.json │ ├── open-swoole-static-wrk.md │ ├── road-runner-health-check-statistics.json │ ├── road-runner-health-check-wrk.json │ ├── road-runner-health-check-wrk.md │ ├── road-runner-http-request-statistics.json │ ├── road-runner-http-request-wrk.json │ ├── road-runner-http-request-wrk.md │ ├── road-runner-static-statistics.json │ ├── road-runner-static-wrk.json │ ├── road-runner-static-wrk.md │ ├── swoole-health-check-statistics.json │ ├── swoole-health-check-wrk.json │ ├── swoole-health-check-wrk.md │ ├── swoole-http-request-statistics.json │ ├── swoole-http-request-wrk.json │ ├── swoole-http-request-wrk.md │ ├── swoole-static-statistics.json │ ├── swoole-static-wrk.json │ └── swoole-static-wrk.md ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore ├── logs │ └── .gitignore └── table │ ├── cpu-usage-health-check.csv │ ├── cpu-usage-http-request.csv │ ├── cpu-usage-static.csv │ ├── latency-distribution-health-check.csv │ ├── latency-distribution-http-request.csv │ ├── latency-distribution-static.csv │ ├── memory-usage-health-check.csv │ ├── memory-usage-http-request.csv │ ├── memory-usage-static.csv │ ├── request-per-second.csv │ ├── requests.csv │ └── transfer-per-second.csv ├── swoole.Dockerfile ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── Pest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── 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 | APP_NAME=Laravel 2 | APP_ENV=prod 3 | APP_KEY=base64:VuJAZkyAa3bSwXbSQIlx7kmbNZFTbTdP1rEV9D8jnmE= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | LOG_DEPRECATIONS_CHANNEL=null 9 | LOG_LEVEL=debug 10 | 11 | DB_CONNECTION=mysql 12 | DB_HOST=127.0.0.1 13 | DB_PORT=3306 14 | DB_DATABASE=laravel_benchmark 15 | DB_USERNAME=root 16 | DB_PASSWORD= 17 | 18 | BROADCAST_DRIVER=log 19 | CACHE_DRIVER=file 20 | FILESYSTEM_DISK=local 21 | QUEUE_CONNECTION=sync 22 | SESSION_DRIVER=file 23 | SESSION_LIFETIME=120 24 | 25 | MEMCACHED_HOST=127.0.0.1 26 | 27 | REDIS_HOST=127.0.0.1 28 | REDIS_PASSWORD=null 29 | REDIS_PORT=6379 30 | 31 | MAIL_MAILER=smtp 32 | MAIL_HOST=mailpit 33 | MAIL_PORT=1025 34 | MAIL_USERNAME=null 35 | MAIL_PASSWORD=null 36 | MAIL_ENCRYPTION=null 37 | MAIL_FROM_ADDRESS="hello@example.com" 38 | MAIL_FROM_NAME="${APP_NAME}" 39 | 40 | AWS_ACCESS_KEY_ID= 41 | AWS_SECRET_ACCESS_KEY= 42 | AWS_DEFAULT_REGION=us-east-1 43 | AWS_BUCKET= 44 | AWS_USE_PATH_STYLE_ENDPOINT=false 45 | 46 | PUSHER_APP_ID= 47 | PUSHER_APP_KEY= 48 | PUSHER_APP_SECRET= 49 | PUSHER_HOST= 50 | PUSHER_PORT=443 51 | PUSHER_SCHEME=https 52 | PUSHER_APP_CLUSTER=mt1 53 | 54 | VITE_APP_NAME="${APP_NAME}" 55 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 56 | VITE_PUSHER_HOST="${PUSHER_HOST}" 57 | VITE_PUSHER_PORT="${PUSHER_PORT}" 58 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 59 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 60 | -------------------------------------------------------------------------------- /.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/build 4 | /public/hot 5 | /public/storage 6 | /storage/*.key 7 | /vendor 8 | .env 9 | .env.backup 10 | .env.production 11 | .phpunit.result.cache 12 | Homestead.json 13 | Homestead.yaml 14 | auth.json 15 | npm-debug.log 16 | yarn-error.log 17 | /.fleet 18 | /.idea 19 | /.vscode 20 | 21 | /caddy 22 | frankenphp 23 | frankenphp-worker.php 24 | rr 25 | .rr.yaml 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Laravel Benchmark 2 | 3 | 4 | ### Install 5 | 6 | ```bash 7 | wget https://raw.githubusercontent.com/thecaliskan/laravel-benchmark/master/docker-compose.yml 8 | 9 | docker compose up -d 10 | ``` 11 | 12 | ### Benchmark 13 | 14 | 15 | #### OpenSwoole 16 | ```bash 17 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9801/api/health-check 18 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9801/api/static 19 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9801/api/http-request 20 | ``` 21 | 22 | #### Swoole 23 | 24 | ```bash 25 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9802/api/health-check 26 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9802/api/static 27 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9802/api/http-request 28 | ``` 29 | 30 | #### RoadRunner 31 | 32 | ```bash 33 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9803/api/health-check 34 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9803/api/static 35 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9803/api/http-request 36 | ``` 37 | 38 | #### FrankenPHP 39 | 40 | ```bash 41 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9804/api/health-check 42 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9804/api/static 43 | wrk -t16 -c100 -d30s --latency http://127.0.0.1:9804/api/http-request 44 | ``` 45 | -------------------------------------------------------------------------------- /app/Console/Commands/BenchmarkCommand.php: -------------------------------------------------------------------------------- 1 | throw(); 36 | sleep(3); 37 | 38 | $process = Process::start($serverEnum->getBenchmarkCommand($endpointEnum)); 39 | 40 | $statistics = []; 41 | usleep(1000000 - now()->microsecond); 42 | while ($process->running()) { 43 | if (isset($statistics[now()->toAtomString()])) { 44 | usleep(1000000 - now()->microsecond); 45 | 46 | continue; 47 | } 48 | $statistics[now()->toAtomString()] = Process::start($serverEnum->getStatsCommand()); 49 | } 50 | 51 | $benchmarkOutput = $process->wait()->output(); 52 | 53 | foreach ($statistics as $key => $statistic) { 54 | $statistics[$key] = json_decode($statistic->wait()->output(), true); 55 | } 56 | 57 | $explodedBenchmarkOutput = explode("\nJSON Output:\n", $benchmarkOutput); 58 | 59 | Storage::disk('benchmark')->put( 60 | $endpointEnum->getFileName($serverEnum)->append('-wrk.md'), 61 | $explodedBenchmarkOutput[0] 62 | ); 63 | 64 | Storage::disk('benchmark')->put( 65 | $endpointEnum->getFileName($serverEnum)->append('-wrk.json'), 66 | json_encode(json_decode($explodedBenchmarkOutput[1]), JSON_PRETTY_PRINT) 67 | ); 68 | 69 | Storage::disk('benchmark')->put( 70 | $endpointEnum->getFileName($serverEnum)->append('-statistics.json'), 71 | json_encode($statistics, JSON_PRETTY_PRINT) 72 | ); 73 | } 74 | } 75 | 76 | $this->generateTables(); 77 | 78 | return true; 79 | } 80 | 81 | protected function arrayToCsv(string $filename, array $data): void 82 | { 83 | $csv = fopen(storage_path('table/'.$filename.'.csv'), 'w'); 84 | foreach ($data as $datum) { 85 | fputcsv($csv, $datum, ',', '"'); 86 | } 87 | fclose($csv); 88 | } 89 | 90 | protected function getBenchmarkData($serverEnum, $endpointEnum): Collection 91 | { 92 | return collect(json_decode(Storage::disk('benchmark')->get($endpointEnum->getFileName($serverEnum)->append('-wrk.json')), true)); 93 | } 94 | 95 | protected function getStatisticsData($serverEnum, $endpointEnum): Collection 96 | { 97 | return collect(json_decode(Storage::disk('benchmark')->get($endpointEnum->getFileName($serverEnum)->append('-statistics.json')), true)); 98 | } 99 | 100 | public function generateTables(): void 101 | { 102 | $this->generateRequestsTable(); 103 | $this->generateRequestPerSecondTable(); 104 | $this->generateTransferPerSecondTable(); 105 | $this->generateLatencyDistributionTable(); 106 | $this->generateCpuUsageTable(); 107 | $this->generateMemoryUsageTable(); 108 | } 109 | 110 | public function generateRequestPerSecondTable(): void 111 | { 112 | $data = [['Server']]; 113 | 114 | foreach (EndpointEnum::cases() as $endpointEnum) { 115 | $data[0][] = $endpointEnum->getTitle(); 116 | } 117 | 118 | foreach (ServerEnum::cases() as $serverEnum) { 119 | $data[$serverEnum->name][] = $serverEnum->getTitle(); 120 | foreach (EndpointEnum::cases() as $endpointEnum) { 121 | $data[$serverEnum->name][] = $this->getBenchmarkData($serverEnum, $endpointEnum)->get('requests_per_sec'); 122 | } 123 | } 124 | 125 | $this->arrayToCsv('request-per-second', $data); 126 | } 127 | 128 | public function generateRequestsTable(): void 129 | { 130 | $data = [['Server']]; 131 | 132 | foreach (EndpointEnum::cases() as $endpointEnum) { 133 | $data[0][] = $endpointEnum->getTitle(); 134 | } 135 | 136 | foreach (ServerEnum::cases() as $serverEnum) { 137 | $data[$serverEnum->name][] = $serverEnum->getTitle(); 138 | foreach (EndpointEnum::cases() as $endpointEnum) { 139 | $data[$serverEnum->name][] = $this->getBenchmarkData($serverEnum, $endpointEnum)->get('requests'); 140 | } 141 | } 142 | 143 | $this->arrayToCsv('requests', $data); 144 | } 145 | 146 | public function generateTransferPerSecondTable(): void 147 | { 148 | $data = [['Server']]; 149 | 150 | foreach (EndpointEnum::cases() as $endpointEnum) { 151 | $data[0][] = $endpointEnum->getTitle(); 152 | } 153 | 154 | foreach (ServerEnum::cases() as $serverEnum) { 155 | $data[$serverEnum->name][] = $serverEnum->getTitle(); 156 | foreach (EndpointEnum::cases() as $endpointEnum) { 157 | $data[$serverEnum->name][] = $this->getBenchmarkData($serverEnum, $endpointEnum)->get('bytes_transfer_per_sec') / 1024 / 1024; 158 | } 159 | } 160 | 161 | $this->arrayToCsv('transfer-per-second', $data); 162 | } 163 | 164 | public function generateLatencyDistributionTable(): void 165 | { 166 | foreach (EndpointEnum::cases() as $endpointEnum) { 167 | $data = [['Server', '50%', '75%', '90%', '99%', '99.99%']]; 168 | foreach (ServerEnum::cases() as $serverEnum) { 169 | $data[$serverEnum->name][] = $serverEnum->getTitle(); 170 | 171 | foreach ($this->getBenchmarkData($serverEnum, $endpointEnum)->get('latency_distributions') as $latencyDistribution) { 172 | $data[$serverEnum->name][] = $latencyDistribution['latency_in_microseconds'] / 1000; 173 | } 174 | } 175 | $this->arrayToCsv('latency-distribution-'.$endpointEnum->getKebabCase(), $data); 176 | } 177 | } 178 | 179 | public function generateCpuUsageTable(): void 180 | { 181 | foreach (EndpointEnum::cases() as $endpointEnum) { 182 | $data = [[ 183 | 'Server', 184 | ...array_map( 185 | fn ($second) => str($second)->padLeft(2, 0)->prepend('00:'), 186 | range(1, $endpointEnum->getBenchmarkDuration() - 1) 187 | ), 188 | ]]; 189 | foreach (ServerEnum::cases() as $serverEnum) { 190 | $data[$serverEnum->name] = [ 191 | $serverEnum->getTitle(), 192 | ...$this->getStatisticsData($serverEnum, $endpointEnum) 193 | ->pluck('CPUPerc') 194 | ->slice(0, $endpointEnum->getBenchmarkDuration() - 1) 195 | ->map(fn ($percentage) => str_replace('%', '', $percentage)), 196 | ]; 197 | } 198 | $this->arrayToCsv('cpu-usage-'.$endpointEnum->getKebabCase(), $data); 199 | } 200 | } 201 | 202 | public function generateMemoryUsageTable(): void 203 | { 204 | foreach (EndpointEnum::cases() as $endpointEnum) { 205 | $data = [[ 206 | 'Server', 207 | ...array_map( 208 | fn ($second) => str($second)->padLeft(2, 0)->prepend('00:'), 209 | range(1, $endpointEnum->getBenchmarkDuration()) 210 | ), 211 | ]]; 212 | foreach (ServerEnum::cases() as $serverEnum) { 213 | $data[$serverEnum->name] = [ 214 | $serverEnum->getTitle(), 215 | ...$this->getStatisticsData($serverEnum, $endpointEnum) 216 | ->pluck('MemUsage') 217 | ->slice(0, $endpointEnum->getBenchmarkDuration()) 218 | ->map(fn ($usage) => str($usage)->contains('GiB /') ? explode('GiB', $usage)[0] * 1024 : explode('MiB', $usage)[0]), 219 | ]; 220 | } 221 | $this->arrayToCsv('memory-usage-'.$endpointEnum->getKebabCase(), $data); 222 | } 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 16 | } 17 | 18 | /** 19 | * Register the commands for the application. 20 | */ 21 | protected function commands(): void 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Enums/EndpointEnum.php: -------------------------------------------------------------------------------- 1 | route('health-check', [], false), 17 | self::Static => route('static', [], false), 18 | self::HttpRequest => route('http-request', [], false), 19 | }; 20 | } 21 | 22 | public function getFileName(ServerEnum $serverEnum): Stringable 23 | { 24 | return str($serverEnum->name.$this->name)->replace('PHP', 'Php')->kebab(); 25 | } 26 | 27 | public function getBenchmarkDuration(): int 28 | { 29 | return match ($this) { 30 | default => 30, 31 | }; 32 | } 33 | 34 | public function getKebabCase(): string 35 | { 36 | return str($this->name)->kebab(); 37 | } 38 | 39 | public function getTitle(): string 40 | { 41 | return str($this->name)->snake(' ')->title(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Enums/ServerEnum.php: -------------------------------------------------------------------------------- 1 | 9801, 16 | self::Swoole => 9802, 17 | self::RoadRunner => 9803, 18 | self::FrankenPHP => 9804, 19 | }; 20 | } 21 | 22 | public function getBenchmarkCommand(EndpointEnum $endpointEnum): string 23 | { 24 | return 'wrk -t16 -c100 -d'.$endpointEnum->getBenchmarkDuration().'s -s json.lua --latency http://127.0.0.1:'.$this->getPort().$endpointEnum->getRoute(); 25 | } 26 | 27 | public function getStatsCommand(): string 28 | { 29 | return 'docker stats '.strtolower($this->name).' --format=json --no-stream'; 30 | } 31 | 32 | public function getTitle(): string 33 | { 34 | return $this->name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $dontFlash = [ 16 | 'current_password', 17 | 'password', 18 | 'password_confirmation', 19 | ]; 20 | 21 | /** 22 | * Register the exception handling callbacks for the application. 23 | */ 24 | public function register(): void 25 | { 26 | $this->reportable(function (Throwable $e) { 27 | // 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | // \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', 44 | // \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's middleware aliases. 50 | * 51 | * Aliases may be used instead of class names to conveniently assign middleware to routes and groups. 52 | * 53 | * @var array 54 | */ 55 | protected $middlewareAliases = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 64 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 65 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 66 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 67 | ]; 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson() ? null : route('login'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 24 | return redirect(RouteServiceProvider::HOME); 25 | } 26 | } 27 | 28 | return $next($request); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts(): array 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 19 | */ 20 | protected $fillable = [ 21 | 'name', 22 | 'email', 23 | 'password', 24 | ]; 25 | 26 | /** 27 | * The attributes that should be hidden for serialization. 28 | * 29 | * @var array 30 | */ 31 | protected $hidden = [ 32 | 'password', 33 | 'remember_token', 34 | ]; 35 | 36 | /** 37 | * The attributes that should be cast. 38 | * 39 | * @var array 40 | */ 41 | protected $casts = [ 42 | 'email_verified_at' => 'datetime', 43 | 'password' => 'hashed', 44 | ]; 45 | } 46 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->singletonIf(HttpService::class, function () { 16 | return new HttpService(); 17 | }); 18 | } 19 | 20 | /** 21 | * Bootstrap any application services. 22 | */ 23 | public function boot(): void 24 | { 25 | // 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | */ 22 | public function boot(): void 23 | { 24 | // 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | */ 26 | public function boot(): void 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Determine if events and listeners should be automatically discovered. 33 | */ 34 | public function shouldDiscoverEvents(): bool 35 | { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | by($request->user()?->id ?: $request->ip()); 29 | }); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Services/HttpService.php: -------------------------------------------------------------------------------- 1 | curlHandle = curl_init(); 14 | } 15 | 16 | public function get(string $url): string 17 | { 18 | curl_setopt($this->curlHandle, CURLOPT_URL, $url); 19 | curl_setopt($this->curlHandle, CURLOPT_RETURNTRANSFER, true); 20 | 21 | return curl_exec($this->curlHandle); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The skeleton application for the Laravel framework.", 5 | "keywords": ["laravel", "framework"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.1", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "laravel/framework": "^10.10", 11 | "laravel/octane": "^2.2", 12 | "laravel/sanctum": "^3.3", 13 | "laravel/tinker": "^2.8", 14 | "spiral/roadrunner-cli": "^2.5.0", 15 | "spiral/roadrunner-http": "^3.0.1", 16 | "ext-curl": "*" 17 | }, 18 | "require-dev": { 19 | "fakerphp/faker": "^1.9.1", 20 | "laravel/pint": "^1.13", 21 | "laravel/sail": "^1.18", 22 | "mockery/mockery": "^1.4.4", 23 | "nunomaduro/collision": "^7.0", 24 | "pestphp/pest": "^2.0", 25 | "pestphp/pest-plugin-laravel": "^2.0", 26 | "spatie/laravel-ignition": "^2.0" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "App\\": "app/", 31 | "Database\\Factories\\": "database/factories/", 32 | "Database\\Seeders\\": "database/seeders/" 33 | } 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Tests\\": "tests/" 38 | } 39 | }, 40 | "scripts": { 41 | "post-autoload-dump": [ 42 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 43 | "@php artisan package:discover --ansi" 44 | ], 45 | "post-update-cmd": [ 46 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 47 | ], 48 | "post-root-package-install": [ 49 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 50 | ], 51 | "post-create-project-cmd": [ 52 | "@php artisan key:generate --ansi" 53 | ], 54 | "format": "vendor/bin/pint" 55 | }, 56 | "extra": { 57 | "laravel": { 58 | "dont-discover": [] 59 | } 60 | }, 61 | "config": { 62 | "optimize-autoloader": true, 63 | "preferred-install": "dist", 64 | "sort-packages": true, 65 | "allow-plugins": { 66 | "pestphp/pest-plugin": true, 67 | "php-http/discovery": true 68 | } 69 | }, 70 | "minimum-stability": "stable", 71 | "prefer-stable": true 72 | } 73 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Application Environment 24 | |-------------------------------------------------------------------------- 25 | | 26 | | This value determines the "environment" your application is currently 27 | | running in. This may determine how you prefer to configure various 28 | | services the application utilizes. Set this in your ".env" file. 29 | | 30 | */ 31 | 32 | 'env' => env('APP_ENV', 'production'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Application Debug Mode 37 | |-------------------------------------------------------------------------- 38 | | 39 | | When your application is in debug mode, detailed error messages with 40 | | stack traces will be shown on every error that occurs within your 41 | | application. If disabled, a simple generic error page is shown. 42 | | 43 | */ 44 | 45 | 'debug' => (bool) env('APP_DEBUG', false), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Application URL 50 | |-------------------------------------------------------------------------- 51 | | 52 | | This URL is used by the console to properly generate URLs when using 53 | | the Artisan command line tool. You should set this to the root of 54 | | your application so that it is used when running Artisan tasks. 55 | | 56 | */ 57 | 58 | 'url' => env('APP_URL', 'http://localhost'), 59 | 60 | 'asset_url' => env('ASSET_URL'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Application Timezone 65 | |-------------------------------------------------------------------------- 66 | | 67 | | Here you may specify the default timezone for your application, which 68 | | will be used by the PHP date and date-time functions. We have gone 69 | | ahead and set this to a sensible default for you out of the box. 70 | | 71 | */ 72 | 73 | 'timezone' => 'UTC', 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Application Locale Configuration 78 | |-------------------------------------------------------------------------- 79 | | 80 | | The application locale determines the default locale that will be used 81 | | by the translation service provider. You are free to set this value 82 | | to any of the locales which will be supported by the application. 83 | | 84 | */ 85 | 86 | 'locale' => 'en', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Application Fallback Locale 91 | |-------------------------------------------------------------------------- 92 | | 93 | | The fallback locale determines the locale to use when the current one 94 | | is not available. You may change the value to correspond to any of 95 | | the language folders that are provided through your application. 96 | | 97 | */ 98 | 99 | 'fallback_locale' => 'en', 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Faker Locale 104 | |-------------------------------------------------------------------------- 105 | | 106 | | This locale will be used by the Faker PHP library when generating fake 107 | | data for your database seeds. For example, this will be used to get 108 | | localized telephone numbers, street address information and more. 109 | | 110 | */ 111 | 112 | 'faker_locale' => 'en_US', 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Encryption Key 117 | |-------------------------------------------------------------------------- 118 | | 119 | | This key is used by the Illuminate encrypter service and should be set 120 | | to a random, 32 character string, otherwise these encrypted strings 121 | | will not be safe. Please do this before deploying an application! 122 | | 123 | */ 124 | 125 | 'key' => env('APP_KEY'), 126 | 127 | 'cipher' => 'AES-256-CBC', 128 | 129 | /* 130 | |-------------------------------------------------------------------------- 131 | | Maintenance Mode Driver 132 | |-------------------------------------------------------------------------- 133 | | 134 | | These configuration options determine the driver used to determine and 135 | | manage Laravel's "maintenance mode" status. The "cache" driver will 136 | | allow maintenance mode to be controlled across multiple machines. 137 | | 138 | | Supported drivers: "file", "cache" 139 | | 140 | */ 141 | 142 | 'maintenance' => [ 143 | 'driver' => 'file', 144 | // 'store' => 'redis', 145 | ], 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Autoloaded Service Providers 150 | |-------------------------------------------------------------------------- 151 | | 152 | | The service providers listed here will be automatically loaded on the 153 | | request to your application. Feel free to add your own services to 154 | | this array to grant expanded functionality to your applications. 155 | | 156 | */ 157 | 158 | 'providers' => ServiceProvider::defaultProviders()->merge([ 159 | /* 160 | * Package Service Providers... 161 | */ 162 | 163 | /* 164 | * Application Service Providers... 165 | */ 166 | App\Providers\AppServiceProvider::class, 167 | App\Providers\AuthServiceProvider::class, 168 | // App\Providers\BroadcastServiceProvider::class, 169 | App\Providers\EventServiceProvider::class, 170 | App\Providers\RouteServiceProvider::class, 171 | ])->toArray(), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | Class Aliases 176 | |-------------------------------------------------------------------------- 177 | | 178 | | This array of class aliases will be registered when this application 179 | | is started. However, feel free to register as many as you wish as 180 | | the aliases are "lazy" loaded so they don't hinder performance. 181 | | 182 | */ 183 | 184 | 'aliases' => Facade::defaultAliases()->merge([ 185 | // 'Example' => App\Facades\Example::class, 186 | ])->toArray(), 187 | 188 | ]; 189 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => '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 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 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 drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources 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' => 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 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 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' => '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 | | times out and the user is prompted to re-enter their password via the 109 | | confirmation screen. By default, the timeout lasts for three hours. 110 | | 111 | */ 112 | 113 | 'password_timeout' => 10800, 114 | 115 | ]; 116 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 41 | 'port' => env('PUSHER_PORT', 443), 42 | 'scheme' => env('PUSHER_SCHEME', 'https'), 43 | 'encrypted' => true, 44 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 45 | ], 46 | 'client_options' => [ 47 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 48 | ], 49 | ], 50 | 51 | 'ably' => [ 52 | 'driver' => 'ably', 53 | 'key' => env('ABLY_KEY'), 54 | ], 55 | 56 | 'redis' => [ 57 | 'driver' => 'redis', 58 | 'connection' => 'default', 59 | ], 60 | 61 | 'log' => [ 62 | 'driver' => 'log', 63 | ], 64 | 65 | 'null' => [ 66 | 'driver' => 'null', 67 | ], 68 | 69 | ], 70 | 71 | ]; 72 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 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: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | 'lock_path' => storage_path('framework/cache/data'), 56 | ], 57 | 58 | 'memcached' => [ 59 | 'driver' => 'memcached', 60 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 61 | 'sasl' => [ 62 | env('MEMCACHED_USERNAME'), 63 | env('MEMCACHED_PASSWORD'), 64 | ], 65 | 'options' => [ 66 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 67 | ], 68 | 'servers' => [ 69 | [ 70 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 71 | 'port' => env('MEMCACHED_PORT', 11211), 72 | 'weight' => 100, 73 | ], 74 | ], 75 | ], 76 | 77 | 'redis' => [ 78 | 'driver' => 'redis', 79 | 'connection' => 'cache', 80 | 'lock_connection' => 'default', 81 | ], 82 | 83 | 'dynamodb' => [ 84 | 'driver' => 'dynamodb', 85 | 'key' => env('AWS_ACCESS_KEY_ID'), 86 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 87 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 88 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 89 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 90 | ], 91 | 92 | 'octane' => [ 93 | 'driver' => 'octane', 94 | ], 95 | 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Cache Key Prefix 101 | |-------------------------------------------------------------------------- 102 | | 103 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 104 | | stores there might be other applications using the same cache. For 105 | | that reason, you may prefix every cache key to avoid collisions. 106 | | 107 | */ 108 | 109 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'search_path' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 94 | ], 95 | 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Migration Repository Table 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This table keeps track of all the migrations that have already run for 104 | | your application. Using this information, we can determine which of 105 | | the migrations on disk haven't actually been run in the database. 106 | | 107 | */ 108 | 109 | 'migrations' => 'migrations', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Redis Databases 114 | |-------------------------------------------------------------------------- 115 | | 116 | | Redis is an open source, fast, and advanced key-value store that also 117 | | provides a richer body of commands than a typical key-value system 118 | | such as APC or Memcached. Laravel makes it easy to dig right in. 119 | | 120 | */ 121 | 122 | 'redis' => [ 123 | 124 | 'client' => env('REDIS_CLIENT', 'phpredis'), 125 | 126 | 'options' => [ 127 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 129 | ], 130 | 131 | 'default' => [ 132 | 'url' => env('REDIS_URL'), 133 | 'host' => env('REDIS_HOST', '127.0.0.1'), 134 | 'username' => env('REDIS_USERNAME'), 135 | 'password' => env('REDIS_PASSWORD'), 136 | 'port' => env('REDIS_PORT', '6379'), 137 | 'database' => env('REDIS_DB', '0'), 138 | ], 139 | 140 | 'cache' => [ 141 | 'url' => env('REDIS_URL'), 142 | 'host' => env('REDIS_HOST', '127.0.0.1'), 143 | 'username' => env('REDIS_USERNAME'), 144 | 'password' => env('REDIS_PASSWORD'), 145 | 'port' => env('REDIS_PORT', '6379'), 146 | 'database' => env('REDIS_CACHE_DB', '1'), 147 | ], 148 | 149 | ], 150 | 151 | ]; 152 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | 'benchmark' => [ 60 | 'driver' => 'local', 61 | 'root' => storage_path('benchmark'), 62 | 'throw' => false, 63 | ], 64 | 65 | ], 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Symbolic Links 70 | |-------------------------------------------------------------------------- 71 | | 72 | | Here you may configure the symbolic links that will be created when the 73 | | `storage:link` Artisan command is executed. The array keys should be 74 | | the locations of the links and the values should be their targets. 75 | | 76 | */ 77 | 78 | 'links' => [ 79 | public_path('storage') => storage_path('app/public'), 80 | ], 81 | 82 | ]; 83 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 12), 33 | 'verify' => true, 34 | ], 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Argon Options 39 | |-------------------------------------------------------------------------- 40 | | 41 | | Here you may specify the configuration options that should be used when 42 | | passwords are hashed using the Argon algorithm. These will allow you 43 | | to control the amount of time it takes to hash the given password. 44 | | 45 | */ 46 | 47 | 'argon' => [ 48 | 'memory' => 65536, 49 | 'threads' => 1, 50 | 'time' => 4, 51 | 'verify' => true, 52 | ], 53 | 54 | ]; 55 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Deprecations Log Channel 26 | |-------------------------------------------------------------------------- 27 | | 28 | | This option controls the log channel that should be used to log warnings 29 | | regarding deprecated PHP and library features. This allows you to get 30 | | your application ready for upcoming major versions of dependencies. 31 | | 32 | */ 33 | 34 | 'deprecations' => [ 35 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 36 | 'trace' => false, 37 | ], 38 | 39 | /* 40 | |-------------------------------------------------------------------------- 41 | | Log Channels 42 | |-------------------------------------------------------------------------- 43 | | 44 | | Here you may configure the log channels for your application. Out of 45 | | the box, Laravel uses the Monolog PHP logging library. This gives 46 | | you a variety of powerful log handlers / formatters to utilize. 47 | | 48 | | Available Drivers: "single", "daily", "slack", "syslog", 49 | | "errorlog", "monolog", 50 | | "custom", "stack" 51 | | 52 | */ 53 | 54 | 'channels' => [ 55 | 'stack' => [ 56 | 'driver' => 'stack', 57 | 'channels' => ['single'], 58 | 'ignore_exceptions' => false, 59 | ], 60 | 61 | 'single' => [ 62 | 'driver' => 'single', 63 | 'path' => storage_path('logs/laravel.log'), 64 | 'level' => env('LOG_LEVEL', 'debug'), 65 | 'replace_placeholders' => true, 66 | ], 67 | 68 | 'daily' => [ 69 | 'driver' => 'daily', 70 | 'path' => storage_path('logs/laravel.log'), 71 | 'level' => env('LOG_LEVEL', 'debug'), 72 | 'days' => 14, 73 | 'replace_placeholders' => true, 74 | ], 75 | 76 | 'slack' => [ 77 | 'driver' => 'slack', 78 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 79 | 'username' => 'Laravel Log', 80 | 'emoji' => ':boom:', 81 | 'level' => env('LOG_LEVEL', 'critical'), 82 | 'replace_placeholders' => true, 83 | ], 84 | 85 | 'papertrail' => [ 86 | 'driver' => 'monolog', 87 | 'level' => env('LOG_LEVEL', 'debug'), 88 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 89 | 'handler_with' => [ 90 | 'host' => env('PAPERTRAIL_URL'), 91 | 'port' => env('PAPERTRAIL_PORT'), 92 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 93 | ], 94 | 'processors' => [PsrLogMessageProcessor::class], 95 | ], 96 | 97 | 'stderr' => [ 98 | 'driver' => 'monolog', 99 | 'level' => env('LOG_LEVEL', 'debug'), 100 | 'handler' => StreamHandler::class, 101 | 'formatter' => env('LOG_STDERR_FORMATTER'), 102 | 'with' => [ 103 | 'stream' => 'php://stderr', 104 | ], 105 | 'processors' => [PsrLogMessageProcessor::class], 106 | ], 107 | 108 | 'syslog' => [ 109 | 'driver' => 'syslog', 110 | 'level' => env('LOG_LEVEL', 'debug'), 111 | 'facility' => LOG_USER, 112 | 'replace_placeholders' => true, 113 | ], 114 | 115 | 'errorlog' => [ 116 | 'driver' => 'errorlog', 117 | 'level' => env('LOG_LEVEL', 'debug'), 118 | 'replace_placeholders' => true, 119 | ], 120 | 121 | 'null' => [ 122 | 'driver' => 'monolog', 123 | 'handler' => NullHandler::class, 124 | ], 125 | 126 | 'emergency' => [ 127 | 'path' => storage_path('logs/laravel.log'), 128 | ], 129 | ], 130 | 131 | ]; 132 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", 32 | | "postmark", "log", "array", "failover", "roundrobin" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'url' => env('MAIL_URL'), 40 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 41 | 'port' => env('MAIL_PORT', 587), 42 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 43 | 'username' => env('MAIL_USERNAME'), 44 | 'password' => env('MAIL_PASSWORD'), 45 | 'timeout' => null, 46 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 47 | ], 48 | 49 | 'ses' => [ 50 | 'transport' => 'ses', 51 | ], 52 | 53 | 'postmark' => [ 54 | 'transport' => 'postmark', 55 | // 'message_stream_id' => null, 56 | // 'client' => [ 57 | // 'timeout' => 5, 58 | // ], 59 | ], 60 | 61 | 'mailgun' => [ 62 | 'transport' => 'mailgun', 63 | // 'client' => [ 64 | // 'timeout' => 5, 65 | // ], 66 | ], 67 | 68 | 'sendmail' => [ 69 | 'transport' => 'sendmail', 70 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 71 | ], 72 | 73 | 'log' => [ 74 | 'transport' => 'log', 75 | 'channel' => env('MAIL_LOG_CHANNEL'), 76 | ], 77 | 78 | 'array' => [ 79 | 'transport' => 'array', 80 | ], 81 | 82 | 'failover' => [ 83 | 'transport' => 'failover', 84 | 'mailers' => [ 85 | 'smtp', 86 | 'log', 87 | ], 88 | ], 89 | 90 | 'roundrobin' => [ 91 | 'transport' => 'roundrobin', 92 | 'mailers' => [ 93 | 'ses', 94 | 'postmark', 95 | ], 96 | ], 97 | ], 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Global "From" Address 102 | |-------------------------------------------------------------------------- 103 | | 104 | | You may wish for all e-mails sent by your application to be sent from 105 | | the same address. Here, you may specify a name and address that is 106 | | used globally for all e-mails that are sent by your application. 107 | | 108 | */ 109 | 110 | 'from' => [ 111 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 112 | 'name' => env('MAIL_FROM_NAME', 'Example'), 113 | ], 114 | 115 | /* 116 | |-------------------------------------------------------------------------- 117 | | Markdown Mail Settings 118 | |-------------------------------------------------------------------------- 119 | | 120 | | If you are using Markdown based email rendering, you may configure your 121 | | theme and component paths here, allowing you to customize the design 122 | | of the emails. Or, you may simply stick with the Laravel defaults! 123 | | 124 | */ 125 | 126 | 'markdown' => [ 127 | 'theme' => 'default', 128 | 129 | 'paths' => [ 130 | resource_path('views/vendor/mail'), 131 | ], 132 | ], 133 | 134 | ]; 135 | -------------------------------------------------------------------------------- /config/octane.php: -------------------------------------------------------------------------------- 1 | env('OCTANE_SERVER', 'roadrunner'), 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Force HTTPS 45 | |-------------------------------------------------------------------------- 46 | | 47 | | When this configuration value is set to "true", Octane will inform the 48 | | framework that all absolute links must be generated using the HTTPS 49 | | protocol. Otherwise your links may be generated using plain HTTP. 50 | | 51 | */ 52 | 53 | 'https' => env('OCTANE_HTTPS', false), 54 | 55 | /* 56 | |-------------------------------------------------------------------------- 57 | | Octane Listeners 58 | |-------------------------------------------------------------------------- 59 | | 60 | | All of the event listeners for Octane's events are defined below. These 61 | | listeners are responsible for resetting your application's state for 62 | | the next request. You may even add your own listeners to the list. 63 | | 64 | */ 65 | 66 | 'listeners' => [ 67 | WorkerStarting::class => [ 68 | EnsureUploadedFilesAreValid::class, 69 | EnsureUploadedFilesCanBeMoved::class, 70 | ], 71 | 72 | RequestReceived::class => [ 73 | ...Octane::prepareApplicationForNextOperation(), 74 | ...Octane::prepareApplicationForNextRequest(), 75 | // 76 | ], 77 | 78 | RequestHandled::class => [ 79 | // 80 | ], 81 | 82 | RequestTerminated::class => [ 83 | // FlushUploadedFiles::class, 84 | ], 85 | 86 | TaskReceived::class => [ 87 | ...Octane::prepareApplicationForNextOperation(), 88 | // 89 | ], 90 | 91 | TaskTerminated::class => [ 92 | // 93 | ], 94 | 95 | TickReceived::class => [ 96 | ...Octane::prepareApplicationForNextOperation(), 97 | // 98 | ], 99 | 100 | TickTerminated::class => [ 101 | // 102 | ], 103 | 104 | OperationTerminated::class => [ 105 | FlushTemporaryContainerInstances::class, 106 | // DisconnectFromDatabases::class, 107 | // CollectGarbage::class, 108 | ], 109 | 110 | WorkerErrorOccurred::class => [ 111 | ReportException::class, 112 | StopWorkerIfNecessary::class, 113 | ], 114 | 115 | WorkerStopping::class => [ 116 | // 117 | ], 118 | ], 119 | 120 | /* 121 | |-------------------------------------------------------------------------- 122 | | Warm / Flush Bindings 123 | |-------------------------------------------------------------------------- 124 | | 125 | | The bindings listed below will either be pre-warmed when a worker boots 126 | | or they will be flushed before every new request. Flushing a binding 127 | | will force the container to resolve that binding again when asked. 128 | | 129 | */ 130 | 131 | 'warm' => [ 132 | ...Octane::defaultServicesToWarm(), 133 | HttpService::class, 134 | ], 135 | 136 | 'flush' => [ 137 | // 138 | ], 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Octane Swoole Tables 143 | |-------------------------------------------------------------------------- 144 | | 145 | | While using Swoole, you may define additional tables as required by the 146 | | application. These tables can be used to store data that needs to be 147 | | quickly accessed by other workers on the particular Swoole server. 148 | | 149 | */ 150 | 151 | 'tables' => [ 152 | 'example:1000' => [ 153 | 'name' => 'string:1000', 154 | 'votes' => 'int', 155 | ], 156 | ], 157 | 158 | /* 159 | |-------------------------------------------------------------------------- 160 | | Octane Swoole Cache Table 161 | |-------------------------------------------------------------------------- 162 | | 163 | | While using Swoole, you may leverage the Octane cache, which is powered 164 | | by a Swoole table. You may set the maximum number of rows as well as 165 | | the number of bytes per row using the configuration options below. 166 | | 167 | */ 168 | 169 | 'cache' => [ 170 | 'rows' => 1000, 171 | 'bytes' => 10000, 172 | ], 173 | 174 | /* 175 | |-------------------------------------------------------------------------- 176 | | File Watching 177 | |-------------------------------------------------------------------------- 178 | | 179 | | The following list of files and directories will be watched when using 180 | | the --watch option offered by Octane. If any of the directories and 181 | | files are changed, Octane will automatically reload your workers. 182 | | 183 | */ 184 | 185 | 'watch' => [ 186 | 'app', 187 | 'bootstrap', 188 | 'config', 189 | 'database', 190 | 'public/**/*.php', 191 | 'resources/**/*.php', 192 | 'routes', 193 | 'composer.lock', 194 | '.env', 195 | ], 196 | 197 | /* 198 | |-------------------------------------------------------------------------- 199 | | Garbage Collection Threshold 200 | |-------------------------------------------------------------------------- 201 | | 202 | | When executing long-lived PHP scripts such as Octane, memory can build 203 | | up before being cleared by PHP. You can force Octane to run garbage 204 | | collection if your application consumes this amount of megabytes. 205 | | 206 | */ 207 | 208 | 'garbage' => 50, 209 | 210 | /* 211 | |-------------------------------------------------------------------------- 212 | | Maximum Execution Time 213 | |-------------------------------------------------------------------------- 214 | | 215 | | The following setting configures the maximum execution time for requests 216 | | being handled by Octane. You may set this value to 0 to indicate that 217 | | there isn't a specific time limit on Octane request execution time. 218 | | 219 | */ 220 | 221 | 'max_execution_time' => 30, 222 | 223 | ]; 224 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Job Batching 79 | |-------------------------------------------------------------------------- 80 | | 81 | | The following options configure the database and table that store job 82 | | batching information. These options can be updated to any database 83 | | connection and table which has been defined by your application. 84 | | 85 | */ 86 | 87 | 'batching' => [ 88 | 'database' => env('DB_CONNECTION', 'mysql'), 89 | 'table' => 'job_batches', 90 | ], 91 | 92 | /* 93 | |-------------------------------------------------------------------------- 94 | | Failed Queue Jobs 95 | |-------------------------------------------------------------------------- 96 | | 97 | | These options configure the behavior of failed queue job logging so you 98 | | can control which database and table are used to store the jobs that 99 | | have failed. You may change them to any database / table you wish. 100 | | 101 | */ 102 | 103 | 'failed' => [ 104 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 105 | 'database' => env('DB_CONNECTION', 'mysql'), 106 | 'table' => 'failed_jobs', 107 | ], 108 | 109 | ]; 110 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. This will override any values set in the token's 45 | | "expires_at" attribute, but first-party sessions are not affected. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Token Prefix 54 | |-------------------------------------------------------------------------- 55 | | 56 | | Sanctum can prefix new tokens in order to take advantage of numerous 57 | | security scanning initiatives maintained by open source platforms 58 | | that notify developers if they commit tokens into repositories. 59 | | 60 | | See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning 61 | | 62 | */ 63 | 64 | 'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''), 65 | 66 | /* 67 | |-------------------------------------------------------------------------- 68 | | Sanctum Middleware 69 | |-------------------------------------------------------------------------- 70 | | 71 | | When authenticating your first-party SPA with Sanctum you may need to 72 | | customize some of the middleware Sanctum uses while processing the 73 | | request. You may change the middleware listed below as required. 74 | | 75 | */ 76 | 77 | 'middleware' => [ 78 | 'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class, 79 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 80 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 81 | ], 82 | 83 | ]; 84 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION'), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | While using one of the framework's cache driven session backends you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE'), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Session Sweeping Lottery 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Some session drivers must manually sweep their storage location to get 111 | | rid of old sessions from storage. Here are the chances that it will 112 | | happen on a given request. By default, the odds are 2 out of 100. 113 | | 114 | */ 115 | 116 | 'lottery' => [2, 100], 117 | 118 | /* 119 | |-------------------------------------------------------------------------- 120 | | Session Cookie Name 121 | |-------------------------------------------------------------------------- 122 | | 123 | | Here you may change the name of the cookie used to identify a session 124 | | instance by ID. The name specified here will get used every time a 125 | | new session cookie is created by the framework for every driver. 126 | | 127 | */ 128 | 129 | 'cookie' => env( 130 | 'SESSION_COOKIE', 131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Session Cookie Path 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The session cookie path determines the path for which the cookie will 140 | | be regarded as available. Typically, this will be the root path of 141 | | your application but you are free to change this when necessary. 142 | | 143 | */ 144 | 145 | 'path' => '/', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Session Cookie Domain 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Here you may change the domain of the cookie used to identify a session 153 | | in your application. This will determine which domains the cookie is 154 | | available to in your application. A sensible default has been set. 155 | | 156 | */ 157 | 158 | 'domain' => env('SESSION_DOMAIN'), 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | HTTPS Only Cookies 163 | |-------------------------------------------------------------------------- 164 | | 165 | | By setting this option to true, session cookies will only be sent back 166 | | to the server if the browser has a HTTPS connection. This will keep 167 | | the cookie from being sent to you when it can't be done securely. 168 | | 169 | */ 170 | 171 | 'secure' => env('SESSION_SECURE_COOKIE'), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | HTTP Access Only 176 | |-------------------------------------------------------------------------- 177 | | 178 | | Setting this value to true will prevent JavaScript from accessing the 179 | | value of the cookie and the cookie will only be accessible through 180 | | the HTTP protocol. You are free to modify this option if needed. 181 | | 182 | */ 183 | 184 | 'http_only' => true, 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Same-Site Cookies 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This option determines how your cookies behave when cross-site requests 192 | | take place, and can be used to mitigate CSRF attacks. By default, we 193 | | will set this value to "lax" since this is a secure default value. 194 | | 195 | | Supported: "lax", "strict", "none", null 196 | | 197 | */ 198 | 199 | 'same_site' => 'lax', 200 | 201 | /* 202 | |-------------------------------------------------------------------------- 203 | | Partitioned Cookies 204 | |-------------------------------------------------------------------------- 205 | | 206 | | Setting this value to true will tie the cookie to the top-level site for 207 | | a cross-site context. Partitioned cookies are accepted by the browser 208 | | when flagged "secure" and the Same-Site attribute is set to "none". 209 | | 210 | */ 211 | 212 | 'partitioned' => false, 213 | 214 | ]; 215 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class UserFactory extends Factory 13 | { 14 | /** 15 | * The current password being used by the factory. 16 | */ 17 | protected static ?string $password; 18 | 19 | /** 20 | * Define the model's default state. 21 | * 22 | * @return array 23 | */ 24 | public function definition(): array 25 | { 26 | return [ 27 | 'name' => fake()->name(), 28 | 'email' => fake()->unique()->safeEmail(), 29 | 'email_verified_at' => now(), 30 | 'password' => static::$password ??= Hash::make('password'), 31 | 'remember_token' => Str::random(10), 32 | ]; 33 | } 34 | 35 | /** 36 | * Indicate that the model's email address should be unverified. 37 | */ 38 | public function unverified(): static 39 | { 40 | return $this->state(fn (array $attributes) => [ 41 | 'email_verified_at' => null, 42 | ]); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('name'); 17 | $table->string('email')->unique(); 18 | $table->timestamp('email_verified_at')->nullable(); 19 | $table->string('password'); 20 | $table->rememberToken(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('users'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php: -------------------------------------------------------------------------------- 1 | string('email')->primary(); 16 | $table->string('token'); 17 | $table->timestamp('created_at')->nullable(); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | */ 24 | public function down(): void 25 | { 26 | Schema::dropIfExists('password_reset_tokens'); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->string('uuid')->unique(); 17 | $table->text('connection'); 18 | $table->text('queue'); 19 | $table->longText('payload'); 20 | $table->longText('exception'); 21 | $table->timestamp('failed_at')->useCurrent(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | */ 28 | public function down(): void 29 | { 30 | Schema::dropIfExists('failed_jobs'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 16 | $table->morphs('tokenable'); 17 | $table->string('name'); 18 | $table->string('token', 64)->unique(); 19 | $table->text('abilities')->nullable(); 20 | $table->timestamp('last_used_at')->nullable(); 21 | $table->timestamp('expires_at')->nullable(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | */ 29 | public function down(): void 30 | { 31 | Schema::dropIfExists('personal_access_tokens'); 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 16 | 17 | // \App\Models\User::factory()->create([ 18 | // 'name' => 'Test User', 19 | // 'email' => 'test@example.com', 20 | // ]); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | services: 4 | whoami: 5 | container_name: "whoami" 6 | image: "containous/whoami" 7 | openswoole: 8 | container_name: "openswoole" 9 | image: "ghcr.io/thecaliskan/laravel-benchmark:openswoole" 10 | ports: 11 | - "9801:9801" 12 | swoole: 13 | container_name: "swoole" 14 | image: "ghcr.io/thecaliskan/laravel-benchmark:swoole" 15 | ports: 16 | - "9802:9802" 17 | roadrunner: 18 | container_name: "roadrunner" 19 | image: "ghcr.io/thecaliskan/laravel-benchmark:roadrunner" 20 | ports: 21 | - "9803:9803" 22 | frankenphp: 23 | container_name: "frankenphp" 24 | image: "ghcr.io/thecaliskan/laravel-benchmark:frankenphp" 25 | ports: 26 | - "9804:9804" 27 | -------------------------------------------------------------------------------- /frankenphp.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-alpine 2 | 3 | COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ 4 | COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer 5 | 6 | RUN install-php-extensions pcntl sockets 7 | 8 | COPY . /var/www 9 | COPY .env.example /var/www/.env 10 | 11 | WORKDIR /var/www 12 | 13 | RUN apk add jq 14 | 15 | RUN wget -O/usr/local/bin/frankenphp $(wget -O- https://api.github.com/repos/dunglas/frankenphp/releases/latest | jq '.assets[] | select(.name=="frankenphp-linux-x86_64") | .browser_download_url' -r) && chmod +x /usr/local/bin/frankenphp 16 | 17 | RUN composer install --no-dev 18 | 19 | ENTRYPOINT ["php", "artisan", "octane:start", "--server=frankenphp", "--port=9804", "--workers=16", "--host=0.0.0.0"] 20 | -------------------------------------------------------------------------------- /json.lua: -------------------------------------------------------------------------------- 1 | -- example reporting script which demonstrates a custom 2 | -- done() function that prints results as JSON 3 | 4 | done = function(summary, latency, requests) 5 | io.write("\nJSON Output:\n") 6 | io.write("{\n") 7 | io.write(string.format("\t\"requests\": %d,\n", summary.requests)) 8 | io.write(string.format("\t\"duration_in_microseconds\": %0.2f,\n", summary.duration)) 9 | io.write(string.format("\t\"bytes\": %d,\n", summary.bytes)) 10 | io.write(string.format("\t\"requests_per_sec\": %0.2f,\n", (summary.requests/summary.duration)*1e6)) 11 | io.write(string.format("\t\"bytes_transfer_per_sec\": %0.2f,\n", (summary.bytes/summary.duration)*1e6)) 12 | io.write(string.format("\t\"connect_errors\": %d,\n", summary.errors.connect)) 13 | io.write(string.format("\t\"read_errors\": %d,\n", summary.errors.read)) 14 | io.write(string.format("\t\"write_errors\": %d,\n", summary.errors.write)) 15 | io.write(string.format("\t\"http_errors\": %d,\n", summary.errors.status)) 16 | io.write(string.format("\t\"timeouts\": %d,\n", summary.errors.timeout)) 17 | io.write("\t\"latency_distributions\": [\n") 18 | for _, p in pairs({ 50, 75, 90, 99, 99.99 }) do 19 | io.write("\t\t{\n") 20 | n = latency:percentile(p) 21 | io.write(string.format("\t\t\t\"percentile\": %g,\n\t\t\t\"latency_in_microseconds\": %d\n", p, n)) 22 | if p == 99.99 then 23 | io.write("\t\t}\n") 24 | else 25 | io.write("\t\t},\n") 26 | end 27 | end 28 | io.write("\t]\n}\n") 29 | end 30 | -------------------------------------------------------------------------------- /openswoole.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-alpine 2 | 3 | COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ 4 | COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer 5 | 6 | RUN install-php-extensions pcntl sockets openswoole 7 | 8 | COPY . /var/www 9 | COPY .env.example /var/www/.env 10 | 11 | WORKDIR /var/www 12 | 13 | RUN composer install --no-dev 14 | 15 | ENTRYPOINT ["php", "artisan", "octane:start", "--server=swoole", "--port=9801", "--workers=16", "--host=0.0.0.0"] 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build" 7 | }, 8 | "devDependencies": { 9 | "axios": "^1.6.1", 10 | "laravel-vite-plugin": "^1.0.0", 11 | "vite": "^5.0.0" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | tests/Unit 10 | 11 | 12 | tests/Feature 13 | 14 | 15 | 16 | 17 | app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thecaliskan/laravel-benchmark/45e31954f94737d9d02649eb2f92175a381ad171/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thecaliskan/laravel-benchmark/45e31954f94737d9d02649eb2f92175a381ad171/resources/css/app.css -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import './bootstrap'; 2 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * We'll load the axios HTTP library which allows us to easily issue requests 3 | * to our Laravel back-end. This library automatically handles sending the 4 | * CSRF token as a header based on the value of the "XSRF" token cookie. 5 | */ 6 | 7 | import axios from 'axios'; 8 | window.axios = axios; 9 | 10 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 11 | 12 | /** 13 | * Echo exposes an expressive API for subscribing to channels and listening 14 | * for events that are broadcast by Laravel. Echo and event broadcasting 15 | * allows your team to easily build robust real-time web applications. 16 | */ 17 | 18 | // import Echo from 'laravel-echo'; 19 | 20 | // import Pusher from 'pusher-js'; 21 | // window.Pusher = Pusher; 22 | 23 | // window.Echo = new Echo({ 24 | // broadcaster: 'pusher', 25 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 26 | // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1', 27 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 28 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 29 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 30 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 31 | // enabledTransports: ['ws', 'wss'], 32 | // }); 33 | -------------------------------------------------------------------------------- /roadrunner.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-alpine 2 | 3 | COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ 4 | COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer 5 | COPY --from=ghcr.io/roadrunner-server/roadrunner:latest /usr/bin/rr /usr/local/bin/rr 6 | 7 | RUN install-php-extensions pcntl sockets 8 | 9 | COPY . /var/www 10 | COPY .env.example /var/www/.env 11 | 12 | WORKDIR /var/www 13 | 14 | RUN composer install --no-dev 15 | 16 | ENTRYPOINT ["php", "artisan", "octane:start", "--server=roadrunner", "--port=9803", "--workers=16", "--host=0.0.0.0"] 17 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | Response::noContent())->name('health-check'); 20 | Route::get('/static', fn (Request $request) => Response::json(['status' => true]))->name('static'); 21 | Route::get('/http-request', fn (Request $request, HttpService $httpService) => Response::json(json_decode($httpService->get('http://whoami/api'))))->name('http-request'); 22 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 18 | 19 | return $app; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 5 | 6 | $response->assertStatus(200); 7 | }); 8 | -------------------------------------------------------------------------------- /tests/Pest.php: -------------------------------------------------------------------------------- 1 | in('Feature'); 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Expectations 22 | |-------------------------------------------------------------------------- 23 | | 24 | | When you're writing tests, you often need to check that values meet certain conditions. The 25 | | "expect()" function gives you access to a set of "expectations" methods that you can use 26 | | to assert different things. Of course, you may extend the Expectation API at any time. 27 | | 28 | */ 29 | 30 | expect()->extend('toBeOne', function () { 31 | return $this->toBe(1); 32 | }); 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | Functions 37 | |-------------------------------------------------------------------------- 38 | | 39 | | While Pest is very powerful out-of-the-box, you may have some testing code specific to your 40 | | project that you don't want to repeat in every file. Here you can also expose helpers as 41 | | global functions to help you to reduce the number of lines of code in your test files. 42 | | 43 | */ 44 | 45 | function something() 46 | { 47 | // .. 48 | } 49 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | toBeTrue(); 5 | }); 6 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | laravel({ 7 | input: ['resources/css/app.css', 'resources/js/app.js'], 8 | refresh: true, 9 | }), 10 | ], 11 | }); 12 | --------------------------------------------------------------------------------