├── .dockerignore ├── .env.example ├── .gitattributes ├── .gitignore ├── Dockerfile ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ ├── Controller.php │ │ ├── HomeController.php │ │ └── OrderController.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ └── VerifyCsrfToken.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php └── User.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ └── 2014_10_12_100000_create_password_resets_table.php └── seeds │ └── DatabaseSeeder.php ├── deploy ├── app │ ├── deploy.yml │ ├── image-pull.yml │ ├── namespace.json │ ├── secret.yml │ └── service.yml ├── deploy.conf ├── dockerfile ├── mysql │ ├── gce-volume.yaml │ ├── install.md │ ├── mysql-deployment.yaml │ ├── mysql-persistent-volume-claim.yml │ └── mysql-service.yaml ├── redis │ ├── redis-master-deployment.yaml │ ├── redis-service.yaml │ └── redis-slave-deployment.yaml ├── run ├── supervisord.conf └── www.conf ├── docker-compose.yml ├── docker ├── nginx │ ├── default.conf │ └── nginx.conf └── php │ ├── Dockerfile │ └── custom.ini ├── entrypoint ├── local-volumes.yaml ├── mysql-deployment.yaml ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ └── app.css ├── favicon.ico ├── index.php ├── js │ └── app.js ├── robots.txt └── web.config ├── push.sh ├── readme.md ├── resources ├── assets │ ├── js │ │ ├── app.js │ │ ├── bootstrap.js │ │ └── components │ │ │ └── Example.vue │ └── sass │ │ ├── _variables.scss │ │ └── app.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── auth │ ├── login.blade.php │ ├── passwords │ │ ├── email.blade.php │ │ └── reset.blade.php │ └── register.blade.php │ ├── home.blade.php │ ├── layouts │ └── app.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.dockerignore: -------------------------------------------------------------------------------- 1 | .env 2 | .git 3 | deploy/app 4 | deploy/worker 5 | deploy/mysql 6 | deploy/env 7 | docker 8 | docker-compose.yml 9 | docker-compose.yml.example 10 | .idea 11 | .DS_Store 12 | 13 | storage/logs/*.log 14 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_LOG_LEVEL=debug 6 | APP_URL=http://localhost 7 | 8 | DB_CONNECTION=mysql 9 | DB_HOST=127.0.0.1 10 | DB_PORT=3306 11 | DB_DATABASE=homestead 12 | DB_USERNAME=homestead 13 | DB_PASSWORD=secret 14 | 15 | BROADCAST_DRIVER=log 16 | CACHE_DRIVER=file 17 | SESSION_DRIVER=file 18 | QUEUE_DRIVER=sync 19 | 20 | REDIS_HOST=127.0.0.1 21 | REDIS_PASSWORD=null 22 | REDIS_PORT=6379 23 | 24 | MAIL_DRIVER=smtp 25 | MAIL_HOST=smtp.mailtrap.io 26 | MAIL_PORT=2525 27 | MAIL_USERNAME=null 28 | MAIL_PASSWORD=null 29 | MAIL_ENCRYPTION=null 30 | 31 | PUSHER_APP_ID= 32 | PUSHER_APP_KEY= 33 | PUSHER_APP_SECRET= 34 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /vendor 3 | /.idea 4 | .env 5 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.0-fpm 2 | 3 | RUN docker-php-ext-install pdo_mysql 4 | RUN apt-get update && apt-get install -y \ 5 | libmcrypt-dev \ 6 | && docker-php-ext-install -j$(nproc) mcrypt \ 7 | && docker-php-ext-install -j$(nproc) pdo 8 | 9 | RUN apt-get install -y nginx supervisor && \ 10 | rm -rf /var/lib/apt/lists/* 11 | 12 | COPY . /var/www/html 13 | WORKDIR /var/www/html 14 | 15 | RUN rm /etc/nginx/sites-enabled/default 16 | 17 | COPY /docker/nginx/nginx.conf /etc/nginx/conf.d/default.conf 18 | 19 | 20 | RUN chmod +x ./entrypoint 21 | 22 | ENTRYPOINT ["./entrypoint"] 23 | 24 | EXPOSE 80 -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 60 | return response()->json(['error' => 'Unauthenticated.'], 401); 61 | } 62 | 63 | return redirect()->guest(route('login')); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|string|max:255', 52 | 'email' => 'required|string|email|max:255|unique:users', 53 | 'password' => 'required|string|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return \App\User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Http\Response 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/OrderController.php: -------------------------------------------------------------------------------- 1 | [ 30 | \App\Http\Middleware\EncryptCookies::class, 31 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 32 | \Illuminate\Session\Middleware\StartSession::class, 33 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 34 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 35 | \App\Http\Middleware\VerifyCsrfToken::class, 36 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 37 | ], 38 | 39 | 'api' => [ 40 | 'throttle:60,1', 41 | 'bindings', 42 | ], 43 | ]; 44 | 45 | /** 46 | * The application's route middleware. 47 | * 48 | * These middleware may be assigned to groups or used individually. 49 | * 50 | * @var array 51 | */ 52 | protected $routeMiddleware = [ 53 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 54 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 55 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 56 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 57 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 58 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 59 | ]; 60 | } 61 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running, we will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /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/autoload.php: -------------------------------------------------------------------------------- 1 | =5.6.4", 9 | "laravel/framework": "5.4.*", 10 | "laravel/tinker": "~1.0" 11 | }, 12 | "require-dev": { 13 | "fzaninotto/faker": "~1.4", 14 | "mockery/mockery": "0.9.*", 15 | "phpunit/phpunit": "~5.7" 16 | }, 17 | "autoload": { 18 | "classmap": [ 19 | "database" 20 | ], 21 | "psr-4": { 22 | "App\\": "app/" 23 | } 24 | }, 25 | "autoload-dev": { 26 | "psr-4": { 27 | "Tests\\": "tests/" 28 | } 29 | }, 30 | "scripts": { 31 | "post-root-package-install": [ 32 | "php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 33 | ], 34 | "post-create-project-cmd": [ 35 | "php artisan key:generate" 36 | ], 37 | "post-install-cmd": [ 38 | "Illuminate\\Foundation\\ComposerScripts::postInstall", 39 | "php artisan optimize" 40 | ], 41 | "post-update-cmd": [ 42 | "Illuminate\\Foundation\\ComposerScripts::postUpdate", 43 | "php artisan optimize" 44 | ] 45 | }, 46 | "config": { 47 | "preferred-install": "dist", 48 | "sort-packages": true, 49 | "optimize-autoloader": true 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Application Environment 20 | |-------------------------------------------------------------------------- 21 | | 22 | | This value determines the "environment" your application is currently 23 | | running in. This may determine how you prefer to configure various 24 | | services your application utilizes. Set this in your ".env" file. 25 | | 26 | */ 27 | 28 | 'env' => env('APP_ENV', 'production'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Application Debug Mode 33 | |-------------------------------------------------------------------------- 34 | | 35 | | When your application is in debug mode, detailed error messages with 36 | | stack traces will be shown on every error that occurs within your 37 | | application. If disabled, a simple generic error page is shown. 38 | | 39 | */ 40 | 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Application URL 46 | |-------------------------------------------------------------------------- 47 | | 48 | | This URL is used by the console to properly generate URLs when using 49 | | the Artisan command line tool. You should set this to the root of 50 | | your application so that it is used when running Artisan tasks. 51 | | 52 | */ 53 | 54 | 'url' => env('APP_URL', 'http://localhost'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Application Timezone 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Here you may specify the default timezone for your application, which 62 | | will be used by the PHP date and date-time functions. We have gone 63 | | ahead and set this to a sensible default for you out of the box. 64 | | 65 | */ 66 | 67 | 'timezone' => 'UTC', 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Application Locale Configuration 72 | |-------------------------------------------------------------------------- 73 | | 74 | | The application locale determines the default locale that will be used 75 | | by the translation service provider. You are free to set this value 76 | | to any of the locales which will be supported by the application. 77 | | 78 | */ 79 | 80 | 'locale' => 'en', 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Application Fallback Locale 85 | |-------------------------------------------------------------------------- 86 | | 87 | | The fallback locale determines the locale to use when the current one 88 | | is not available. You may change the value to correspond to any of 89 | | the language folders that are provided through your application. 90 | | 91 | */ 92 | 93 | 'fallback_locale' => 'en', 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Encryption Key 98 | |-------------------------------------------------------------------------- 99 | | 100 | | This key is used by the Illuminate encrypter service and should be set 101 | | to a random, 32 character string, otherwise these encrypted strings 102 | | will not be safe. Please do this before deploying an application! 103 | | 104 | */ 105 | 106 | 'key' => env('APP_KEY'), 107 | 108 | 'cipher' => 'AES-256-CBC', 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Logging Configuration 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may configure the log settings for your application. Out of 116 | | the box, Laravel uses the Monolog PHP logging library. This gives 117 | | you a variety of powerful log handlers / formatters to utilize. 118 | | 119 | | Available Settings: "single", "daily", "syslog", "errorlog" 120 | | 121 | */ 122 | 123 | 'log' => env('APP_LOG', 'single'), 124 | 125 | 'log_level' => env('APP_LOG_LEVEL', 'debug'), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Autoloaded Service Providers 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The service providers listed here will be automatically loaded on the 133 | | request to your application. Feel free to add your own services to 134 | | this array to grant expanded functionality to your applications. 135 | | 136 | */ 137 | 138 | 'providers' => [ 139 | 140 | /* 141 | * Laravel Framework Service Providers... 142 | */ 143 | Illuminate\Auth\AuthServiceProvider::class, 144 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 145 | Illuminate\Bus\BusServiceProvider::class, 146 | Illuminate\Cache\CacheServiceProvider::class, 147 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 148 | Illuminate\Cookie\CookieServiceProvider::class, 149 | Illuminate\Database\DatabaseServiceProvider::class, 150 | Illuminate\Encryption\EncryptionServiceProvider::class, 151 | Illuminate\Filesystem\FilesystemServiceProvider::class, 152 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 153 | Illuminate\Hashing\HashServiceProvider::class, 154 | Illuminate\Mail\MailServiceProvider::class, 155 | Illuminate\Notifications\NotificationServiceProvider::class, 156 | Illuminate\Pagination\PaginationServiceProvider::class, 157 | Illuminate\Pipeline\PipelineServiceProvider::class, 158 | Illuminate\Queue\QueueServiceProvider::class, 159 | Illuminate\Redis\RedisServiceProvider::class, 160 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 161 | Illuminate\Session\SessionServiceProvider::class, 162 | Illuminate\Translation\TranslationServiceProvider::class, 163 | Illuminate\Validation\ValidationServiceProvider::class, 164 | Illuminate\View\ViewServiceProvider::class, 165 | 166 | /* 167 | * Package Service Providers... 168 | */ 169 | Laravel\Tinker\TinkerServiceProvider::class, 170 | 171 | /* 172 | * Application Service Providers... 173 | */ 174 | App\Providers\AppServiceProvider::class, 175 | App\Providers\AuthServiceProvider::class, 176 | // App\Providers\BroadcastServiceProvider::class, 177 | App\Providers\EventServiceProvider::class, 178 | App\Providers\RouteServiceProvider::class, 179 | 180 | ], 181 | 182 | /* 183 | |-------------------------------------------------------------------------- 184 | | Class Aliases 185 | |-------------------------------------------------------------------------- 186 | | 187 | | This array of class aliases will be registered when this application 188 | | is started. However, feel free to register as many as you wish as 189 | | the aliases are "lazy" loaded so they don't hinder performance. 190 | | 191 | */ 192 | 193 | 'aliases' => [ 194 | 195 | 'App' => Illuminate\Support\Facades\App::class, 196 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 197 | 'Auth' => Illuminate\Support\Facades\Auth::class, 198 | 'Blade' => Illuminate\Support\Facades\Blade::class, 199 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 200 | 'Bus' => Illuminate\Support\Facades\Bus::class, 201 | 'Cache' => Illuminate\Support\Facades\Cache::class, 202 | 'Config' => Illuminate\Support\Facades\Config::class, 203 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 204 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 205 | 'DB' => Illuminate\Support\Facades\DB::class, 206 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 207 | 'Event' => Illuminate\Support\Facades\Event::class, 208 | 'File' => Illuminate\Support\Facades\File::class, 209 | 'Gate' => Illuminate\Support\Facades\Gate::class, 210 | 'Hash' => Illuminate\Support\Facades\Hash::class, 211 | 'Lang' => Illuminate\Support\Facades\Lang::class, 212 | 'Log' => Illuminate\Support\Facades\Log::class, 213 | 'Mail' => Illuminate\Support\Facades\Mail::class, 214 | 'Notification' => Illuminate\Support\Facades\Notification::class, 215 | 'Password' => Illuminate\Support\Facades\Password::class, 216 | 'Queue' => Illuminate\Support\Facades\Queue::class, 217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 218 | 'Redis' => Illuminate\Support\Facades\Redis::class, 219 | 'Request' => Illuminate\Support\Facades\Request::class, 220 | 'Response' => Illuminate\Support\Facades\Response::class, 221 | 'Route' => Illuminate\Support\Facades\Route::class, 222 | 'Schema' => Illuminate\Support\Facades\Schema::class, 223 | 'Session' => Illuminate\Support\Facades\Session::class, 224 | 'Storage' => Illuminate\Support\Facades\Storage::class, 225 | 'URL' => Illuminate\Support\Facades\URL::class, 226 | 'Validator' => Illuminate\Support\Facades\Validator::class, 227 | 'View' => Illuminate\Support\Facades\View::class, 228 | 229 | ], 230 | 231 | ]; 232 | -------------------------------------------------------------------------------- /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", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User Providers 53 | |-------------------------------------------------------------------------- 54 | | 55 | | All authentication drivers have a user provider. This defines how the 56 | | users are actually retrieved out of your database or other storage 57 | | mechanisms used by this application to persist your user's data. 58 | | 59 | | If you have multiple user tables or models you may configure multiple 60 | | sources which represent each model / table. These sources may then 61 | | be assigned to any extra authentication guards you have defined. 62 | | 63 | | Supported: "database", "eloquent" 64 | | 65 | */ 66 | 67 | 'providers' => [ 68 | 'users' => [ 69 | 'driver' => 'eloquent', 70 | 'model' => App\User::class, 71 | ], 72 | 73 | // 'users' => [ 74 | // 'driver' => 'database', 75 | // 'table' => 'users', 76 | // ], 77 | ], 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Resetting Passwords 82 | |-------------------------------------------------------------------------- 83 | | 84 | | You may specify multiple password reset configurations if you have more 85 | | than one user table or model in the application and you want to have 86 | | separate password reset settings based on the specific user types. 87 | | 88 | | The expire time is the number of minutes that the reset token should be 89 | | considered valid. This security feature keeps tokens short-lived so 90 | | they have less time to be guessed. You may change this as needed. 91 | | 92 | */ 93 | 94 | 'passwords' => [ 95 | 'users' => [ 96 | 'provider' => 'users', 97 | 'table' => 'password_resets', 98 | 'expire' => 60, 99 | ], 100 | ], 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /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 | // 40 | ], 41 | ], 42 | 43 | 'redis' => [ 44 | 'driver' => 'redis', 45 | 'connection' => 'default', 46 | ], 47 | 48 | 'log' => [ 49 | 'driver' => 'log', 50 | ], 51 | 52 | 'null' => [ 53 | 'driver' => 'null', 54 | ], 55 | 56 | ], 57 | 58 | ]; 59 | -------------------------------------------------------------------------------- /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 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache/data'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Database Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here are each of the database connections setup for your application. 24 | | Of course, examples of configuring each database platform that is 25 | | supported by Laravel is shown below to make development simple. 26 | | 27 | | 28 | | All database work in Laravel is done through the PHP PDO facilities 29 | | so make sure you have the driver for your particular database of 30 | | choice installed on your machine before you begin development. 31 | | 32 | */ 33 | 34 | 'connections' => [ 35 | 36 | 'sqlite' => [ 37 | 'driver' => 'sqlite', 38 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 39 | 'prefix' => '', 40 | ], 41 | 42 | 'mysql' => [ 43 | 'driver' => 'mysql', 44 | 'host' => env('DB_HOST', '127.0.0.1'), 45 | 'port' => env('DB_PORT', '3306'), 46 | 'database' => env('DB_DATABASE', 'forge'), 47 | 'username' => env('DB_USERNAME', 'forge'), 48 | 'password' => env('DB_PASSWORD', ''), 49 | 'unix_socket' => env('DB_SOCKET', ''), 50 | 'charset' => 'utf8mb4', 51 | 'collation' => 'utf8mb4_unicode_ci', 52 | 'prefix' => '', 53 | 'strict' => true, 54 | 'engine' => null, 55 | ], 56 | 57 | 'pgsql' => [ 58 | 'driver' => 'pgsql', 59 | 'host' => env('DB_HOST', '127.0.0.1'), 60 | 'port' => env('DB_PORT', '5432'), 61 | 'database' => env('DB_DATABASE', 'forge'), 62 | 'username' => env('DB_USERNAME', 'forge'), 63 | 'password' => env('DB_PASSWORD', ''), 64 | 'charset' => 'utf8', 65 | 'prefix' => '', 66 | 'schema' => 'public', 67 | 'sslmode' => 'prefer', 68 | ], 69 | 70 | 'sqlsrv' => [ 71 | 'driver' => 'sqlsrv', 72 | 'host' => env('DB_HOST', 'localhost'), 73 | 'port' => env('DB_PORT', '1433'), 74 | 'database' => env('DB_DATABASE', 'forge'), 75 | 'username' => env('DB_USERNAME', 'forge'), 76 | 'password' => env('DB_PASSWORD', ''), 77 | 'charset' => 'utf8', 78 | 'prefix' => '', 79 | ], 80 | 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Migration Repository Table 86 | |-------------------------------------------------------------------------- 87 | | 88 | | This table keeps track of all the migrations that have already run for 89 | | your application. Using this information, we can determine which of 90 | | the migrations on disk haven't actually been run in the database. 91 | | 92 | */ 93 | 94 | 'migrations' => 'migrations', 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Redis Databases 99 | |-------------------------------------------------------------------------- 100 | | 101 | | Redis is an open source, fast, and advanced key-value store that also 102 | | provides a richer set of commands than a typical key-value systems 103 | | such as APC or Memcached. Laravel makes it easy to dig right in. 104 | | 105 | */ 106 | 107 | 'redis' => [ 108 | 109 | 'client' => 'predis', 110 | 111 | 'default' => [ 112 | 'host' => env('REDIS_HOST', '127.0.0.1'), 113 | 'password' => env('REDIS_PASSWORD', null), 114 | 'port' => env('REDIS_PORT', 6379), 115 | 'database' => 0, 116 | ], 117 | 118 | ], 119 | 120 | ]; 121 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_KEY'), 61 | 'secret' => env('AWS_SECRET'), 62 | 'region' => env('AWS_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | ], 65 | 66 | ], 67 | 68 | ]; 69 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | ]; 124 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Queue Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may configure the connection information for each server that 26 | | is used by your application. A default configuration has been added 27 | | for each back-end shipped with Laravel. You are free to add more. 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 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | ], 50 | 51 | 'sqs' => [ 52 | 'driver' => 'sqs', 53 | 'key' => 'your-public-key', 54 | 'secret' => 'your-secret-key', 55 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 56 | 'queue' => 'your-queue-name', 57 | 'region' => 'us-east-1', 58 | ], 59 | 60 | 'redis' => [ 61 | 'driver' => 'redis', 62 | 'connection' => 'default', 63 | 'queue' => 'default', 64 | 'retry_after' => 90, 65 | ], 66 | 67 | ], 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Failed Queue Jobs 72 | |-------------------------------------------------------------------------- 73 | | 74 | | These options configure the behavior of failed queue job logging so you 75 | | can control which database and table are used to store the jobs that 76 | | have failed. You may change them to any database / table you wish. 77 | | 78 | */ 79 | 80 | 'failed' => [ 81 | 'database' => env('DB_CONNECTION', 'mysql'), 82 | 'table' => 'failed_jobs', 83 | ], 84 | 85 | ]; 86 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => 'laravel_session', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Path 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The session cookie path determines the path for which the cookie will 133 | | be regarded as available. Typically, this will be the root path of 134 | | your application but you are free to change this when necessary. 135 | | 136 | */ 137 | 138 | 'path' => '/', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Session Cookie Domain 143 | |-------------------------------------------------------------------------- 144 | | 145 | | Here you may change the domain of the cookie used to identify a session 146 | | in your application. This will determine which domains the cookie is 147 | | available to in your application. A sensible default has been set. 148 | | 149 | */ 150 | 151 | 'domain' => env('SESSION_DOMAIN', null), 152 | 153 | /* 154 | |-------------------------------------------------------------------------- 155 | | HTTPS Only Cookies 156 | |-------------------------------------------------------------------------- 157 | | 158 | | By setting this option to true, session cookies will only be sent back 159 | | to the server if the browser has a HTTPS connection. This will keep 160 | | the cookie from being sent to you if it can not be done securely. 161 | | 162 | */ 163 | 164 | 'secure' => env('SESSION_SECURE_COOKIE', false), 165 | 166 | /* 167 | |-------------------------------------------------------------------------- 168 | | HTTP Access Only 169 | |-------------------------------------------------------------------------- 170 | | 171 | | Setting this value to true will prevent JavaScript from accessing the 172 | | value of the cookie and the cookie will only be accessible through 173 | | the HTTP protocol. You are free to modify this option if needed. 174 | | 175 | */ 176 | 177 | 'http_only' => true, 178 | 179 | ]; 180 | -------------------------------------------------------------------------------- /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' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 16 | static $password; 17 | 18 | return [ 19 | 'name' => $faker->name, 20 | 'email' => $faker->unique()->safeEmail, 21 | 'password' => $password ?: $password = bcrypt('secret'), 22 | 'remember_token' => str_random(10), 23 | ]; 24 | }); 25 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name',255); 19 | $table->string('email',45)->unique(); 20 | $table->string('password',100); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email',45)->index(); 18 | $table->string('token',255); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /deploy/app/deploy.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: laravel 5 | #namespace: laravel 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: laravel-app 11 | template: 12 | metadata: 13 | labels: 14 | app: laravel-app 15 | spec: 16 | containers: 17 | - name: laravel-app 18 | image: docker.io/nahid35/laravel:v4 19 | volumeMounts: 20 | - name: app-secret 21 | mountPath: "/var/www/html/secret" 22 | readOnly: true 23 | ports: 24 | - containerPort: 80 25 | name: pathao-port 26 | protocol: TCP 27 | volumes: 28 | - name: app-secret 29 | secret: 30 | secretName: laravel-app-secret 31 | imagePullSecrets: 32 | - name: regsecret 33 | -------------------------------------------------------------------------------- /deploy/app/image-pull.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | .dockercfg: eyJoYXJib3IucGF0aGFvaW50ZXJuYWwuY29tIjp7InVzZXJuYW1lIjoiazhzIiwicGFzc3dvcmQiOiJBc2RmMTIzNCIsImVtYWlsIjoiZGV2QHBhdGhhby5jb20iLCJhdXRoIjoiYXpoek9rRnpaR1l4TWpNMCJ9fQ== 4 | kind: Secret 5 | metadata: 6 | annotations: 7 | kubectl.kubernetes.io/last-applied-configuration: | 8 | {"apiVersion":"v1","data":{".dockercfg":"eyJoYXJib3IucGF0aGFvaW50ZXJuYWwuY29tIjp7InVzZXJuYW1lIjoiazhzIiwicGFzc3dvcmQiOiJBc2RmMTIzNCIsImVtYWlsIjoiZGV2QHBhdGhhby5jb20iLCJhdXRoIjoiYXpoek9rRnpaR1l4TWpNMCJ9fQ=="},"kind":"Secret","metadata":{"annotations":{},"name":"regsecret","namespace":"on-demand"},"type":"kubernetes.io/dockercfg"} 9 | creationTimestamp: 2017-10-26T10:13:27Z 10 | name: regsecret 11 | namespace: laravel 12 | resourceVersion: "7576205" 13 | selfLink: /api/v1/namespaces/laravel/secrets/regsecret 14 | uid: 4f38b81b-ba36-11e7-a90d-42010a8c0117 15 | type: kubernetes.io/dockercfg 16 | -------------------------------------------------------------------------------- /deploy/app/namespace.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Namespace", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "laravel", 6 | "labels": { 7 | "name": "staging" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /deploy/app/secret.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: laravel-app-secret 5 | #namespace: laravel 6 | type: Opaque 7 | data: 8 | .env: QVBQX05BTUU9TGFyYXZlbApBUFBfRU5WPWxvY2FsCkFQUF9LRVk9YmFzZTY0Ok1sMis3VlNweVZ4bnB4N1kxRE5wSDQreldvL3ZvSHhqOUloWFkvaWc4aXM9CkFQUF9ERUJVRz10cnVlCkFQUF9MT0dfTEVWRUw9ZGVidWcKCgpEQl9DT05ORUNUSU9OPW15c3FsCkRCX0hPU1Q9ZG9ja2VyLmZvci5tYWMubG9jYWxob3N0CkRCX1BPUlQ9MzMwNwpEQl9EQVRBQkFTRT1sYXJhdmVsCkRCX1VTRVJOQU1FPXJvb3QKREJfUEFTU1dPUkQ9Y29tbW9uNDA0CgpCUk9BRENBU1RfRFJJVkVSPWxvZwpDQUNIRV9EUklWRVI9ZmlsZQpTRVNTSU9OX0RSSVZFUj1maWxlClFVRVVFX0RSSVZFUj1zeW5jCgpSRURJU19IT1NUPTEyNy4wLjAuMQpSRURJU19QQVNTV09SRD1udWxsClJFRElTX1BPUlQ9NjM3OQoKTUFJTF9EUklWRVI9c210cApNQUlMX0hPU1Q9c210cC5tYWlsdHJhcC5pbwpNQUlMX1BPUlQ9MjUyNQpNQUlMX1VTRVJOQU1FPW51bGwKTUFJTF9QQVNTV09SRD1udWxsCk1BSUxfRU5DUllQVElPTj1udWxsCgpQVVNIRVJfQVBQX0lEPQpQVVNIRVJfQVBQX0tFWT0KUFVTSEVSX0FQUF9TRUNSRVQ9CkJBQ0tVUF9EQVRBX1BBVEg9fi8uYmFja3Vwcy9sYXJhdmVsCg== 9 | -------------------------------------------------------------------------------- /deploy/app/service.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: laravel-api 5 | #namespace: laravel 6 | spec: 7 | ports: 8 | - name: pat-api-port 9 | port: 80 10 | targetPort: pathao-port 11 | selector: 12 | app: laravel-app 13 | type: LoadBalancer 14 | -------------------------------------------------------------------------------- /deploy/deploy.conf: -------------------------------------------------------------------------------- 1 | server { 2 | # Set the port to listen on and the server name 3 | listen 80 default_server; 4 | 5 | # Set the document root of the project 6 | root /var/www/html/public; 7 | 8 | # Set the directory index files 9 | index index.php index.html index.htm; 10 | 11 | # Specify the default character set 12 | charset utf-8; 13 | 14 | # Setup the default location configuration 15 | location / { 16 | try_files $uri $uri/ /index.php$is_args$args; 17 | } 18 | 19 | # Specify the details of favicon.ico 20 | location = /favicon.ico { access_log off; log_not_found off; } 21 | 22 | # Specify the details of robots.txt 23 | location = /robots.txt { access_log off; log_not_found off; } 24 | 25 | # Specify the logging configuration 26 | access_log /var/log/nginx/access.log; 27 | error_log /var/log/nginx/error.log; 28 | 29 | sendfile off; 30 | 31 | client_max_body_size 100m; 32 | 33 | # Specify what happens when PHP files are requested 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | fastcgi_pass localhost:9000; 37 | fastcgi_index index.php; 38 | include fastcgi_params; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | fastcgi_intercept_errors off; 41 | fastcgi_buffer_size 16k; 42 | fastcgi_buffers 4 16k; 43 | } 44 | 45 | # deny access to .htaccess files 46 | location ~ /\.ht { 47 | deny all; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /deploy/dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.3-fpm 2 | 3 | RUN docker-php-ext-install pdo_mysql 4 | RUN apt-get update && apt-get install -y \ 5 | libpq-dev \ 6 | libmcrypt-dev \ 7 | curl \ 8 | && docker-php-ext-install -j$(nproc) mcrypt \ 9 | && docker-php-ext-install -j$(nproc) pdo \ 10 | && docker-php-ext-install -j$(nproc) pdo_pgsql \ 11 | && docker-php-ext-install -j$(nproc) pdo_mysql \ 12 | && docker-php-ext-install mbstring 13 | 14 | RUN apt-get install nano -y 15 | 16 | RUN apt-get install supervisor -y 17 | 18 | RUN apt-get install -y nginx && \ 19 | rm -rf /var/lib/apt/lists/* 20 | 21 | 22 | COPY . /var/www/html 23 | WORKDIR /var/www/html 24 | 25 | RUN rm /etc/nginx/sites-enabled/default 26 | 27 | COPY ./deploy/deploy.conf /etc/nginx/conf.d/default.conf 28 | 29 | RUN mv /usr/local/etc/php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf.backup 30 | COPY ./deploy/www.conf /usr/local/etc/php-fpm.d/www.conf 31 | 32 | RUN usermod -a -G www-data root 33 | RUN chgrp -R www-data storage 34 | 35 | RUN chown -R www-data:www-data ./storage 36 | RUN chmod -R 0777 ./storage 37 | 38 | 39 | 40 | RUN ln -s ./secret/.env .env 41 | 42 | RUN chmod +x ./deploy/run 43 | 44 | ENTRYPOINT ["./deploy/run"] 45 | 46 | EXPOSE 80 47 | -------------------------------------------------------------------------------- /deploy/mysql/gce-volume.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: mysql-quest-pv 5 | namespace: quests-staging-svc 6 | spec: 7 | capacity: 8 | storage: 10Gi 9 | accessModes: 10 | - ReadWriteOnce 11 | gcePersistentDisk: 12 | pdName: mysql-disk-quests 13 | fsType: ext4 14 | -------------------------------------------------------------------------------- /deploy/mysql/install.md: -------------------------------------------------------------------------------- 1 | gcloud compute disks create --size=10GB mysql-disk-quests-qa 2 | 3 | kubectl create -f gce-volume.yaml 4 | 5 | kubectl create -f mysql-deployment.yaml 6 | 7 | kubectl create -f mysql-service.yaml 8 | 9 | 10 | kubectl get pod 11 | 12 | kubectl run -it --rm --image=mysql:5.6 mysql-client -- mysql -h 10.48.2.26 -p c0mm0nZaq123useer 13 | 14 | kubectl expose service nginx --port=3306 --target-port=3306 --name=mysql-oauth-service 15 | 16 | 17 | LOGIN FOEM MYSQL POD 18 | mysql -u root -p --host 127.0.0.1 19 | -------------------------------------------------------------------------------- /deploy/mysql/mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: mysql-quest-pod 5 | namespace: quests-staging-svc 6 | spec: 7 | strategy: 8 | type: Recreate 9 | template: 10 | metadata: 11 | labels: 12 | app: mysql-quest-pod 13 | spec: 14 | containers: 15 | - image: mysql:5.6 16 | name: mysql 17 | env: 18 | # Use secret in real usage 19 | - name: MYSQL_ROOT_PASSWORD 20 | value: c0mm0nZaq123useer 21 | ports: 22 | - containerPort: 3306 23 | name: mysql 24 | volumeMounts: 25 | - name: mysql-persistent-storage 26 | mountPath: /var/lib/mysql 27 | volumes: 28 | - name: mysql-persistent-storage 29 | persistentVolumeClaim: 30 | claimName: mysql-quest-pv-claim 31 | -------------------------------------------------------------------------------- /deploy/mysql/mysql-persistent-volume-claim.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: mysql-quest-pv-claim 5 | namespace: quests-staging-svc 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | storageClassName: "" 10 | resources: 11 | requests: 12 | storage: 10Gi 13 | -------------------------------------------------------------------------------- /deploy/mysql/mysql-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: mysql-quest-service 5 | namespace: quests-staging-svc 6 | spec: 7 | ports: 8 | - port: 3306 9 | selector: 10 | app: mysql-quest-pod 11 | -------------------------------------------------------------------------------- /deploy/redis/redis-master-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: redis-master 5 | namespace: hermes 6 | # these labels can be applied automatically 7 | # from the labels in the pod template if not set 8 | # labels: 9 | # app: redis 10 | # role: master 11 | # tier: backend 12 | spec: 13 | # this replicas value is default 14 | # modify it according to your case 15 | replicas: 1 16 | # selector can be applied automatically 17 | # from the labels in the pod template if not set 18 | # selector: 19 | # matchLabels: 20 | # app: guestbook 21 | # role: master 22 | # tier: backend 23 | template: 24 | metadata: 25 | labels: 26 | app: redis 27 | role: master 28 | tier: backend 29 | spec: 30 | containers: 31 | - name: master 32 | image: gcr.io/google_containers/redis:e2e # or just image: redis 33 | resources: 34 | requests: 35 | cpu: 100m 36 | memory: 100Mi 37 | ports: 38 | - containerPort: 6379 -------------------------------------------------------------------------------- /deploy/redis/redis-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: redis-master 5 | namespace: hermes 6 | labels: 7 | app: redis 8 | role: master 9 | tier: backend 10 | spec: 11 | ports: 12 | # the port that this service should serve on 13 | - port: 6379 14 | targetPort: 6379 15 | selector: 16 | app: redis 17 | role: master 18 | tier: backend -------------------------------------------------------------------------------- /deploy/redis/redis-slave-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: redis-slave 5 | namespace: hermes 6 | # these labels can be applied automatically 7 | # from the labels in the pod template if not set 8 | # labels: 9 | # app: redis 10 | # role: slave 11 | # tier: backend 12 | spec: 13 | # this replicas value is default 14 | # modify it according to your case 15 | replicas: 1 16 | # selector can be applied automatically 17 | # from the labels in the pod template if not set 18 | # selector: 19 | # matchLabels: 20 | # app: guestbook 21 | # role: slave 22 | # tier: backend 23 | template: 24 | metadata: 25 | labels: 26 | app: redis 27 | role: slave 28 | tier: backend 29 | spec: 30 | containers: 31 | - name: slave 32 | image: gcr.io/google_samples/gb-redisslave:v1 33 | resources: 34 | requests: 35 | cpu: 100m 36 | memory: 100Mi 37 | env: 38 | - name: GET_HOSTS_FROM 39 | value: dns 40 | # If your cluster config does not include a dns service, then to 41 | # instead access an environment variable to find the master 42 | # service's host, comment out the 'value: dns' line above, and 43 | # uncomment the line below. 44 | # value: env 45 | ports: 46 | - containerPort: 6379 -------------------------------------------------------------------------------- /deploy/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | service nginx restart 4 | /usr/bin/supervisord & 5 | php-fpm 6 | -------------------------------------------------------------------------------- /deploy/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:find-driver-worker] 5 | process_name=%(program_name)s_%(process_num)02d 6 | command=php /var/www/html/artisan queue:listen 7 | autostart=true 8 | autorestart=true 9 | user=www-data 10 | numprocs=20 11 | redirect_stderr=true 12 | stdout_logfile=/var/www/html/storage/logs/worker.log -------------------------------------------------------------------------------- /deploy/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or /usr) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = /run/php/php7.0-fpm.sock 37 | listen = 127.0.0.1:9000 38 | 39 | ; Set listen(2) backlog. 40 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 41 | ;listen.backlog = 511 42 | 43 | ; Set permissions for unix socket, if one is used. In Linux, read/write 44 | ; permissions must be set in order to allow connections from a web server. Many 45 | ; BSD-derived systems allow connections regardless of permissions. 46 | ; Default Values: user and group are set as the running user 47 | ; mode is set to 0660 48 | listen.owner = www-data 49 | listen.group = www-data 50 | ;listen.mode = 0660 51 | ; When POSIX Access Control Lists are supported you can set them using 52 | ; these options, value is a comma separated list of user/group names. 53 | ; When set, listen.owner and listen.group are ignored 54 | ;listen.acl_users = 55 | ;listen.acl_groups = 56 | 57 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 58 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 59 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 60 | ; must be separated by a comma. If this value is left blank, connections will be 61 | ; accepted from any ip address. 62 | ; Default Value: any 63 | ;listen.allowed_clients = 127.0.0.1 64 | 65 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 66 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 67 | ; Note: - It will only work if the FPM master process is launched as root 68 | ; - The pool processes will inherit the master process priority 69 | ; unless it specified otherwise 70 | ; Default Value: no set 71 | ; process.priority = -19 72 | 73 | ; Choose how the process manager will control the number of child processes. 74 | ; Possible Values: 75 | ; static - a fixed number (pm.max_children) of child processes; 76 | ; dynamic - the number of child processes are set dynamically based on the 77 | ; following directives. With this process management, there will be 78 | ; always at least 1 children. 79 | ; pm.max_children - the maximum number of children that can 80 | ; be alive at the same time. 81 | ; pm.start_servers - the number of children created on startup. 82 | ; pm.min_spare_servers - the minimum number of children in 'idle' 83 | ; state (waiting to process). If the number 84 | ; of 'idle' processes is less than this 85 | ; number then some children will be created. 86 | ; pm.max_spare_servers - the maximum number of children in 'idle' 87 | ; state (waiting to process). If the number 88 | ; of 'idle' processes is greater than this 89 | ; number then some children will be killed. 90 | ; ondemand - no children are created at startup. Children will be forked when 91 | ; new requests will connect. The following parameter are used: 92 | ; pm.max_children - the maximum number of children that 93 | ; can be alive at the same time. 94 | ; pm.process_idle_timeout - The number of seconds after which 95 | ; an idle process will be killed. 96 | ; Note: This value is mandatory. 97 | pm = ondemand 98 | 99 | ; The number of child processes to be created when pm is set to 'static' and the 100 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 101 | ; This value sets the limit on the number of simultaneous requests that will be 102 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 103 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 104 | ; CGI. The below defaults are based on a server without much resources. Don't 105 | ; forget to tweak pm.* to fit your needs. 106 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 107 | ; Note: This value is mandatory. 108 | pm.max_children = 9000 109 | 110 | ; The number of child processes created on startup. 111 | ; Note: Used only when pm is set to 'dynamic' 112 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 113 | pm.start_servers = 2 114 | 115 | ; The desired minimum number of idle server processes. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Note: Mandatory when pm is set to 'dynamic' 118 | pm.min_spare_servers = 1 119 | 120 | ; The desired maximum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.max_spare_servers = 3 124 | 125 | ; The number of seconds after which an idle process will be killed. 126 | ; Note: Used only when pm is set to 'ondemand' 127 | ; Default Value: 10s 128 | ;pm.process_idle_timeout = 10s; 129 | 130 | ; The number of requests each child process should execute before respawning. 131 | ; This can be useful to work around memory leaks in 3rd party libraries. For 132 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 133 | ; Default Value: 0 134 | ;pm.max_requests = 500 135 | 136 | ; The URI to view the FPM status page. If this value is not set, no URI will be 137 | ; recognized as a status page. It shows the following informations: 138 | ; pool - the name of the pool; 139 | ; process manager - static, dynamic or ondemand; 140 | ; start time - the date and time FPM has started; 141 | ; start since - number of seconds since FPM has started; 142 | ; accepted conn - the number of request accepted by the pool; 143 | ; listen queue - the number of request in the queue of pending 144 | ; connections (see backlog in listen(2)); 145 | ; max listen queue - the maximum number of requests in the queue 146 | ; of pending connections since FPM has started; 147 | ; listen queue len - the size of the socket queue of pending connections; 148 | ; idle processes - the number of idle processes; 149 | ; active processes - the number of active processes; 150 | ; total processes - the number of idle + active processes; 151 | ; max active processes - the maximum number of active processes since FPM 152 | ; has started; 153 | ; max children reached - number of times, the process limit has been reached, 154 | ; when pm tries to start more children (works only for 155 | ; pm 'dynamic' and 'ondemand'); 156 | ; Value are updated in real time. 157 | ; Example output: 158 | ; pool: www 159 | ; process manager: static 160 | ; start time: 01/Jul/2011:17:53:49 +0200 161 | ; start since: 62636 162 | ; accepted conn: 190460 163 | ; listen queue: 0 164 | ; max listen queue: 1 165 | ; listen queue len: 42 166 | ; idle processes: 4 167 | ; active processes: 11 168 | ; total processes: 15 169 | ; max active processes: 12 170 | ; max children reached: 0 171 | ; 172 | ; By default the status page output is formatted as text/plain. Passing either 173 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 174 | ; output syntax. Example: 175 | ; http://www.foo.bar/status 176 | ; http://www.foo.bar/status?json 177 | ; http://www.foo.bar/status?html 178 | ; http://www.foo.bar/status?xml 179 | ; 180 | ; By default the status page only outputs short status. Passing 'full' in the 181 | ; query string will also return status for each pool process. 182 | ; Example: 183 | ; http://www.foo.bar/status?full 184 | ; http://www.foo.bar/status?json&full 185 | ; http://www.foo.bar/status?html&full 186 | ; http://www.foo.bar/status?xml&full 187 | ; The Full status returns for each process: 188 | ; pid - the PID of the process; 189 | ; state - the state of the process (Idle, Running, ...); 190 | ; start time - the date and time the process has started; 191 | ; start since - the number of seconds since the process has started; 192 | ; requests - the number of requests the process has served; 193 | ; request duration - the duration in µs of the requests; 194 | ; request method - the request method (GET, POST, ...); 195 | ; request URI - the request URI with the query string; 196 | ; content length - the content length of the request (only with POST); 197 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 198 | ; script - the main script called (or '-' if not set); 199 | ; last request cpu - the %cpu the last request consumed 200 | ; it's always 0 if the process is not in Idle state 201 | ; because CPU calculation is done when the request 202 | ; processing has terminated; 203 | ; last request memory - the max amount of memory the last request consumed 204 | ; it's always 0 if the process is not in Idle state 205 | ; because memory calculation is done when the request 206 | ; processing has terminated; 207 | ; If the process is in Idle state, then informations are related to the 208 | ; last request the process has served. Otherwise informations are related to 209 | ; the current request being served. 210 | ; Example output: 211 | ; ************************ 212 | ; pid: 31330 213 | ; state: Running 214 | ; start time: 01/Jul/2011:17:53:49 +0200 215 | ; start since: 63087 216 | ; requests: 12808 217 | ; request duration: 1250261 218 | ; request method: GET 219 | ; request URI: /test_mem.php?N=10000 220 | ; content length: 0 221 | ; user: - 222 | ; script: /home/fat/web/docs/php/test_mem.php 223 | ; last request cpu: 0.00 224 | ; last request memory: 0 225 | ; 226 | ; Note: There is a real-time FPM status monitoring sample web page available 227 | ; It's available in: /usr/share/php/7.0/fpm/status.html 228 | ; 229 | ; Note: The value must start with a leading slash (/). The value can be 230 | ; anything, but it may not be a good idea to use the .php extension or it 231 | ; may conflict with a real PHP file. 232 | ; Default Value: not set 233 | pm.status_path = /status 234 | 235 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 236 | ; URI will be recognized as a ping page. This could be used to test from outside 237 | ; that FPM is alive and responding, or to 238 | ; - create a graph of FPM availability (rrd or such); 239 | ; - remove a server from a group if it is not responding (load balancing); 240 | ; - trigger alerts for the operating team (24/7). 241 | ; Note: The value must start with a leading slash (/). The value can be 242 | ; anything, but it may not be a good idea to use the .php extension or it 243 | ; may conflict with a real PHP file. 244 | ; Default Value: not set 245 | ;ping.path = /ping 246 | 247 | ; This directive may be used to customize the response of a ping request. The 248 | ; response is formatted as text/plain with a 200 response code. 249 | ; Default Value: pong 250 | ;ping.response = pong 251 | 252 | ; The access log file 253 | ; Default: not set 254 | ;access.log = log/$pool.access.log 255 | 256 | ; The access log format. 257 | ; The following syntax is allowed 258 | ; %%: the '%' character 259 | ; %C: %CPU used by the request 260 | ; it can accept the following format: 261 | ; - %{user}C for user CPU only 262 | ; - %{system}C for system CPU only 263 | ; - %{total}C for user + system CPU (default) 264 | ; %d: time taken to serve the request 265 | ; it can accept the following format: 266 | ; - %{seconds}d (default) 267 | ; - %{miliseconds}d 268 | ; - %{mili}d 269 | ; - %{microseconds}d 270 | ; - %{micro}d 271 | ; %e: an environment variable (same as $_ENV or $_SERVER) 272 | ; it must be associated with embraces to specify the name of the env 273 | ; variable. Some exemples: 274 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 275 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 276 | ; %f: script filename 277 | ; %l: content-length of the request (for POST request only) 278 | ; %m: request method 279 | ; %M: peak of memory allocated by PHP 280 | ; it can accept the following format: 281 | ; - %{bytes}M (default) 282 | ; - %{kilobytes}M 283 | ; - %{kilo}M 284 | ; - %{megabytes}M 285 | ; - %{mega}M 286 | ; %n: pool name 287 | ; %o: output header 288 | ; it must be associated with embraces to specify the name of the header: 289 | ; - %{Content-Type}o 290 | ; - %{X-Powered-By}o 291 | ; - %{Transfert-Encoding}o 292 | ; - .... 293 | ; %p: PID of the child that serviced the request 294 | ; %P: PID of the parent of the child that serviced the request 295 | ; %q: the query string 296 | ; %Q: the '?' character if query string exists 297 | ; %r: the request URI (without the query string, see %q and %Q) 298 | ; %R: remote IP address 299 | ; %s: status (response code) 300 | ; %t: server time the request was received 301 | ; it can accept a strftime(3) format: 302 | ; %d/%b/%Y:%H:%M:%S %z (default) 303 | ; The strftime(3) format must be encapsuled in a %{}t tag 304 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 305 | ; %T: time the log has been written (the request has finished) 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %u: remote user 311 | ; 312 | ; Default: "%R - %u %t \"%m %r\" %s" 313 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 314 | 315 | ; The log file for slow requests 316 | ; Default Value: not set 317 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 318 | ;slowlog = log/$pool.log.slow 319 | 320 | ; The timeout for serving a single request after which a PHP backtrace will be 321 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 322 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 323 | ; Default Value: 0 324 | ;request_slowlog_timeout = 0 325 | 326 | ; The timeout for serving a single request after which the worker process will 327 | ; be killed. This option should be used when the 'max_execution_time' ini option 328 | ; does not stop script execution for some reason. A value of '0' means 'off'. 329 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 330 | ; Default Value: 0 331 | ;request_terminate_timeout = 0 332 | 333 | ; Set open file descriptor rlimit. 334 | ; Default Value: system defined value 335 | ;rlimit_files = 1024 336 | 337 | ; Set max core size rlimit. 338 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 339 | ; Default Value: system defined value 340 | ;rlimit_core = 0 341 | 342 | ; Chroot to this directory at the start. This value must be defined as an 343 | ; absolute path. When this value is not set, chroot is not used. 344 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 345 | ; of its subdirectories. If the pool prefix is not set, the global prefix 346 | ; will be used instead. 347 | ; Note: chrooting is a great security feature and should be used whenever 348 | ; possible. However, all PHP paths will be relative to the chroot 349 | ; (error_log, sessions.save_path, ...). 350 | ; Default Value: not set 351 | ;chroot = 352 | 353 | ; Chdir to this directory at the start. 354 | ; Note: relative path can be used. 355 | ; Default Value: current directory or / when chroot 356 | ;chdir = /var/www 357 | 358 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 359 | ; stderr will be redirected to /dev/null according to FastCGI specs. 360 | ; Note: on highloaded environement, this can cause some delay in the page 361 | ; process time (several ms). 362 | ; Default Value: no 363 | ;catch_workers_output = yes 364 | 365 | ; Clear environment in FPM workers 366 | ; Prevents arbitrary environment variables from reaching FPM worker processes 367 | ; by clearing the environment in workers before env vars specified in this 368 | ; pool configuration are added. 369 | ; Setting to "no" will make all environment variables available to PHP code 370 | ; via getenv(), $_ENV and $_SERVER. 371 | ; Default Value: yes 372 | ;clear_env = no 373 | 374 | ; Limits the extensions of the main script FPM will allow to parse. This can 375 | ; prevent configuration mistakes on the web server side. You should only limit 376 | ; FPM to .php extensions to prevent malicious users to use other extensions to 377 | ; execute php code. 378 | ; Note: set an empty value to allow all extensions. 379 | ; Default Value: .php 380 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 381 | 382 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 383 | ; the current environment. 384 | ; Default Value: clean env 385 | ;env[HOSTNAME] = $HOSTNAME 386 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 387 | ;env[TMP] = /tmp 388 | ;env[TMPDIR] = /tmp 389 | ;env[TEMP] = /tmp 390 | 391 | ; Additional php.ini defines, specific to this pool of workers. These settings 392 | ; overwrite the values previously defined in the php.ini. The directives are the 393 | ; same as the PHP SAPI: 394 | ; php_value/php_flag - you can set classic ini defines which can 395 | ; be overwritten from PHP call 'ini_set'. 396 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 397 | ; PHP call 'ini_set' 398 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 399 | 400 | ; Defining 'extension' will load the corresponding shared extension from 401 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 402 | ; overwrite previously defined php.ini values, but will append the new value 403 | ; instead. 404 | 405 | ; Note: path INI options can be relative and will be expanded with the prefix 406 | ; (pool, global or /usr) 407 | 408 | ; Default Value: nothing is defined by default except the values in php.ini and 409 | ; specified at startup with the -d argument 410 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 411 | ;php_flag[display_errors] = off 412 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 413 | ;php_admin_flag[log_errors] = on 414 | ;php_admin_value[memory_limit] = 32M -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | 5 | nginx: 6 | image: nginx:latest 7 | ports: 8 | - 8083:80 9 | volumes: 10 | - ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf 11 | volumes_from: 12 | - php 13 | 14 | php: 15 | build: ./docker/php/ 16 | volumes: 17 | - .:/var/www/html 18 | - ./docker/php/custom.ini:/usr/local/etc/php/conf.d/custom.ini 19 | links: 20 | - database 21 | 22 | environment: 23 | - "DB_PORT=3306" 24 | - "DB_HOST=database" 25 | 26 | database: 27 | image: mysql:5.7 28 | environment: 29 | - "MYSQL_ROOT_PASSWORD=common404" 30 | - "MYSQL_DATABASE=laravel" 31 | volumes: 32 | - ${BACKUP_DATA_PATH}/mysql3:/var/lib/mysql 33 | ports: 34 | - "33065:3306" 35 | 36 | -------------------------------------------------------------------------------- /docker/nginx/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | # Set the port to listen on and the server name 3 | listen 80 default_server; 4 | 5 | # Set the document root of the project 6 | root /var/www/html/public; 7 | 8 | # Set the directory index files 9 | index index.php index.html index.htm; 10 | 11 | # Specify the default character set 12 | charset utf-8; 13 | 14 | # Setup the default location configuration 15 | location / { 16 | try_files $uri $uri/ /index.php?$args; 17 | } 18 | 19 | # Specify the details of favicon.ico 20 | location = /favicon.ico { access_log off; log_not_found off; } 21 | 22 | # Specify the details of robots.txt 23 | location = /robots.txt { access_log off; log_not_found off; } 24 | 25 | # Specify the logging configuration 26 | access_log /var/log/nginx/access.log; 27 | error_log /var/log/nginx/error.log; 28 | 29 | sendfile off; 30 | 31 | client_max_body_size 100m; 32 | 33 | # Specify what happens when PHP files are requested 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | fastcgi_pass php:9000; 37 | fastcgi_index index.php?$args; 38 | include fastcgi_params; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | fastcgi_intercept_errors off; 41 | fastcgi_buffer_size 16k; 42 | fastcgi_buffers 4 16k; 43 | } 44 | 45 | # deny access to .htaccess files 46 | location ~ /\.ht { 47 | deny all; 48 | } 49 | } -------------------------------------------------------------------------------- /docker/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | # Set the port to listen on and the server name 3 | listen 80 default_server; 4 | 5 | # Set the document root of the project 6 | root /var/www/html/public; 7 | 8 | # Set the directory index files 9 | index index.php index.html index.htm; 10 | 11 | # Specify the default character set 12 | charset utf-8; 13 | 14 | # Setup the default location configuration 15 | location / { 16 | try_files $uri $uri/ /index.php?$args; 17 | } 18 | 19 | # Specify the details of favicon.ico 20 | location = /favicon.ico { access_log off; log_not_found off; } 21 | 22 | # Specify the details of robots.txt 23 | location = /robots.txt { access_log off; log_not_found off; } 24 | 25 | # Specify the logging configuration 26 | access_log /var/log/nginx/access.log; 27 | error_log /var/log/nginx/error.log; 28 | 29 | sendfile off; 30 | 31 | client_max_body_size 100m; 32 | 33 | # Specify what happens when PHP files are requested 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | fastcgi_pass localhost:9000; 37 | fastcgi_index index.php?$args; 38 | include fastcgi_params; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | fastcgi_intercept_errors off; 41 | fastcgi_buffer_size 16k; 42 | fastcgi_buffers 4 16k; 43 | } 44 | 45 | # deny access to .htaccess files 46 | location ~ /\.ht { 47 | deny all; 48 | } 49 | } -------------------------------------------------------------------------------- /docker/php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.3-fpm 2 | 3 | RUN apt-get update && apt-get install zlib1g-dev -y \ 4 | libmcrypt-dev \ 5 | libpq-dev \ 6 | libjpeg-dev \ 7 | libpng-dev \ 8 | supervisor \ 9 | git zip \ 10 | && docker-php-ext-install -j$(nproc) mcrypt \ 11 | && docker-php-ext-install -j$(nproc) pdo \ 12 | && docker-php-ext-install -j$(nproc) pdo_pgsql \ 13 | && docker-php-ext-install -j$(nproc) gd 14 | 15 | 16 | RUN curl -sS https://getcomposer.org/installer | \ 17 | php -- --install-dir=/usr/bin/ --filename=composer 18 | -------------------------------------------------------------------------------- /docker/php/custom.ini: -------------------------------------------------------------------------------- 1 | log_errors = On 2 | error_log = /dev/stderr 3 | memory_limit = 512M -------------------------------------------------------------------------------- /entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | service nginx restart 4 | php-fpm 5 | while true; do sleep 1d; done 6 | -------------------------------------------------------------------------------- /local-volumes.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: local-pv-1 5 | labels: 6 | type: local 7 | spec: 8 | capacity: 9 | storage: 5Gi 10 | accessModes: 11 | - ReadWriteOnce 12 | hostPath: 13 | path: /tmp/data/pv-1 14 | --- 15 | apiVersion: v1 16 | kind: PersistentVolume 17 | metadata: 18 | name: local-pv-2 19 | labels: 20 | type: local 21 | spec: 22 | capacity: 23 | storage: 5Gi 24 | accessModes: 25 | - ReadWriteOnce 26 | hostPath: 27 | path: /tmp/data/pv-2 28 | -------------------------------------------------------------------------------- /mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: laravel-mysql 5 | labels: 6 | app: laravel-mysql-svc 7 | spec: 8 | ports: 9 | - name: mysql-svc-port 10 | port: 3306 11 | targetPort: mysql-port 12 | selector: 13 | app: laravel-mysql 14 | clusterIP: None 15 | --- 16 | apiVersion: v1 17 | kind: PersistentVolumeClaim 18 | metadata: 19 | name: mysql-pv-claim 20 | labels: 21 | app: laravel 22 | spec: 23 | accessModes: 24 | - ReadWriteOnce 25 | resources: 26 | requests: 27 | storage: 5Gi 28 | --- 29 | apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1 30 | kind: Deployment 31 | metadata: 32 | name: laravel-mysql 33 | labels: 34 | app: laravel 35 | spec: 36 | selector: 37 | matchLabels: 38 | app: laravel-mysql 39 | strategy: 40 | type: Recreate 41 | template: 42 | metadata: 43 | labels: 44 | app: laravel-mysql 45 | spec: 46 | containers: 47 | - image: mysql:5.6 48 | name: mysql 49 | env: 50 | - name: MYSQL_ROOT_PASSWORD 51 | valueFrom: 52 | secretKeyRef: 53 | name: mysql-pass 54 | key: password 55 | ports: 56 | - containerPort: 3306 57 | name: mysql-port 58 | volumeMounts: 59 | - name: mysql-persistent-storage 60 | mountPath: /var/lib/mysql 61 | volumes: 62 | - name: mysql-persistent-storage 63 | persistentVolumeClaim: 64 | claimName: mysql-pv-claim 65 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.16.2", 14 | "bootstrap-sass": "^3.3.7", 15 | "cross-env": "^5.0.1", 16 | "jquery": "^3.1.1", 17 | "laravel-mix": "^1.0", 18 | "lodash": "^4.17.4", 19 | "vue": "^2.1.10" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Feature 14 | 15 | 16 | 17 | ./tests/Unit 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nahidulhasan/laravel-docker-k8s/e3b9bfd27fee121a2730953cbb1fe25347352e49/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels great to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /push.sh: -------------------------------------------------------------------------------- 1 | docker build . -f ./deploy/dockerfile -t laravel:v4 2 | 3 | docker tag laravel:v4 docker.io/nahid35/laravel:v4 4 | 5 | docker push docker.io/nahid35/laravel:v4 6 | 7 | 8 | kubectl apply -f deploy/app/secret.yml 9 | 10 | kubectl apply -f deploy/app/deploy.yml 11 | 12 | kubectl apply -f deploy/app/service.yml 13 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Laravel-docker-kubernetes 4 | 5 | From here you will be able to know that how you will run your Laravel project using Docker and how you will deploy using Kubernetes(minikube) 6 | 7 | ### Run the project using docker 8 | 9 | ``` 10 | Clone the project 11 | ``` 12 | 13 | Now run the following command from your terminal one by one. Running the commands be sure that you have installed docker.You will get install instructions from this 14 | [link](https://docs.docker.com/) 15 | 16 | ```sh 17 | docker-compose build 18 | 19 | ``` 20 | 21 | 22 | ```sh 23 | docker-compose up -d 24 | 25 | ``` 26 | 27 | Now browse project 28 | 29 | ``` 30 | http://localhost:8083/ 31 | ``` 32 | 33 | ### Deploy the project using Kubernetes 34 | 35 | At first build image running the command: 36 | 37 | ```sh 38 | docker build . -f ./deploy/dockerfile -t laravel:v4 39 | 40 | ``` 41 | 42 | Now login in docker hub. Running the command be sure that you have created an account in docker hub. If not go to the 43 | [link](https://hub.docker.com/) and create account. 44 | 45 | ``` 46 | docker login 47 | ``` 48 | 49 | Now run the following command for Pushing image in docker registry.In the command nahid35 is my docker id and laravel is repository name and v4 is tag name. 50 | Modify command according to your docker id, repository name and tag name. 51 | 52 | ``` 53 | docker tag laravel:v4 docker.io/nahid35/laravel:v4 54 | ``` 55 | 56 | ``` 57 | docker push docker.io/nahid35/laravel:v4 58 | ``` 59 | 60 | Now run minikube. Running the commands be sure that you have installed minikube. 61 | If not installed, you can get install instructions from this [link](https://kubernetes.io/docs/tasks/tools/install-minikube/) 62 | 63 | ``` 64 | minikube start 65 | ``` 66 | 67 | Now run the following commands for deploying App from your project directory : 68 | 69 | ``` 70 | alias kubectl="minikube kubectl --" 71 | 72 | kubectl apply -f deploy/app/secret.yml 73 | 74 | kubectl apply -f deploy/app/deploy.yml 75 | 76 | kubectl apply -f deploy/app/service.yml 77 | ``` 78 | 79 | Now run the following commands to see minikube dashboard: 80 | 81 | ``` 82 | minikube dashboard 83 | ``` 84 | 85 | You will get this url : 86 | 87 | ``` 88 | http://192.168.99.100:30000/#!/overview?namespace=default 89 | ``` 90 | 91 | 92 | ``` 93 | kubectl get svc 94 | ``` 95 | 96 | Running above command you will get following information: 97 | 98 | 99 | NAME | TYPE | CLUSTER-IP | EXTERNAL-IP | PORT(S) | AGE 100 | ---------|---------------|-----------------|----------------|------------|---------- 101 | kubernetes | ClusterIP | 10.0.0.1 | | 443/TCP | 27d 102 | laravel-api | LoadBalancer | 10.0.0.11 | | 80:32676/TCP | 4m 103 | 104 | 105 | ``` 106 | minikube service list 107 | ``` 108 | 109 | Running above command you will get following information: 110 | 111 | 112 | | NAMESPACE | NAME | TARGET PORT | URL | 113 | |----------------------|---------------------------|-----------------|---------------------------| 114 | | default | kubernetes | No node port | 115 | | default | laravel-api | pat-api-port/80 | http://192.168.49.2:31223 | 116 | | kube-system | kube-dns | No node port | 117 | | kube-system | metrics-server | No node port | 118 | | kubernetes-dashboard | dashboard-metrics-scraper | No node port | 119 | | kubernetes-dashboard | kubernetes-dashboard | No node port | 120 | 121 | 122 | Now you can browse your project using following url : 123 | 124 | 125 | ``` 126 | http://192.168.49.2:31223 127 | ``` 128 | 129 | ### Extra Note : 130 | 131 | > - If you want to use different database or different port etc, You have to change in the docker-compose.yml file. 132 | 133 | > - If you modify .env file, You have to run following command: 134 | 135 | ``` 136 | base64 -b -i deploy/env/.env 137 | ``` 138 | 139 | > - Running the command you will get base 64 encoded string. Put the string in deploy\app\secret.yml. And then run the commands for deploying. 140 | 141 | 142 | -------------------------------------------------------------------------------- /resources/assets/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * Next, we will create a fresh Vue application instance and attach it to 14 | * the page. Then, you may begin adding components to this application 15 | * or customize the JavaScript scaffolding to fit your unique needs. 16 | */ 17 | 18 | Vue.component('example', require('./components/Example.vue')); 19 | 20 | const app = new Vue({ 21 | el: '#app' 22 | }); 23 | -------------------------------------------------------------------------------- /resources/assets/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap-sass'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: 'your-pusher-key' 53 | // }); 54 | -------------------------------------------------------------------------------- /resources/assets/js/components/Example.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/assets/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f5f8fa; 4 | 5 | // Borders 6 | $laravel-border-color: darken($body-bg, 10%); 7 | $list-group-border: $laravel-border-color; 8 | $navbar-default-border: $laravel-border-color; 9 | $panel-default-border: $laravel-border-color; 10 | $panel-inner-border: $laravel-border-color; 11 | 12 | // Brands 13 | $brand-primary: #3097D1; 14 | $brand-info: #8eb4cb; 15 | $brand-success: #2ab27b; 16 | $brand-warning: #cbb956; 17 | $brand-danger: #bf5329; 18 | 19 | // Typography 20 | $icon-font-path: "~bootstrap-sass/assets/fonts/bootstrap/"; 21 | $font-family-sans-serif: "Raleway", sans-serif; 22 | $font-size-base: 14px; 23 | $line-height-base: 1.6; 24 | $text-color: #636b6f; 25 | 26 | // Navbar 27 | $navbar-default-bg: #fff; 28 | 29 | // Buttons 30 | $btn-default-color: $text-color; 31 | 32 | // Inputs 33 | $input-border: lighten($text-color, 40%); 34 | $input-border-focus: lighten($brand-primary, 25%); 35 | $input-color-placeholder: lighten($text-color, 30%); 36 | 37 | // Panels 38 | $panel-default-heading-bg: #fff; 39 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600"); 4 | 5 | // Variables 6 | @import "variables"; 7 | 8 | // Bootstrap 9 | @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 10 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_format' => 'The :attribute does not match the format :format.', 36 | 'different' => 'The :attribute and :other must be different.', 37 | 'digits' => 'The :attribute must be :digits digits.', 38 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 39 | 'dimensions' => 'The :attribute has invalid image dimensions.', 40 | 'distinct' => 'The :attribute field has a duplicate value.', 41 | 'email' => 'The :attribute must be a valid email address.', 42 | 'exists' => 'The selected :attribute is invalid.', 43 | 'file' => 'The :attribute must be a file.', 44 | 'filled' => 'The :attribute field must have a value.', 45 | 'image' => 'The :attribute must be an image.', 46 | 'in' => 'The selected :attribute is invalid.', 47 | 'in_array' => 'The :attribute field does not exist in :other.', 48 | 'integer' => 'The :attribute must be an integer.', 49 | 'ip' => 'The :attribute must be a valid IP address.', 50 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 51 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 52 | 'json' => 'The :attribute must be a valid JSON string.', 53 | 'max' => [ 54 | 'numeric' => 'The :attribute may not be greater than :max.', 55 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 56 | 'string' => 'The :attribute may not be greater than :max characters.', 57 | 'array' => 'The :attribute may not have more than :max items.', 58 | ], 59 | 'mimes' => 'The :attribute must be a file of type: :values.', 60 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 61 | 'min' => [ 62 | 'numeric' => 'The :attribute must be at least :min.', 63 | 'file' => 'The :attribute must be at least :min kilobytes.', 64 | 'string' => 'The :attribute must be at least :min characters.', 65 | 'array' => 'The :attribute must have at least :min items.', 66 | ], 67 | 'not_in' => 'The selected :attribute is invalid.', 68 | 'numeric' => 'The :attribute must be a number.', 69 | 'present' => 'The :attribute field must be present.', 70 | 'regex' => 'The :attribute format is invalid.', 71 | 'required' => 'The :attribute field is required.', 72 | 'required_if' => 'The :attribute field is required when :other is :value.', 73 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 74 | 'required_with' => 'The :attribute field is required when :values is present.', 75 | 'required_with_all' => 'The :attribute field is required when :values is present.', 76 | 'required_without' => 'The :attribute field is required when :values is not present.', 77 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 78 | 'same' => 'The :attribute and :other must match.', 79 | 'size' => [ 80 | 'numeric' => 'The :attribute must be :size.', 81 | 'file' => 'The :attribute must be :size kilobytes.', 82 | 'string' => 'The :attribute must be :size characters.', 83 | 'array' => 'The :attribute must contain :size items.', 84 | ], 85 | 'string' => 'The :attribute must be a string.', 86 | 'timezone' => 'The :attribute must be a valid zone.', 87 | 'unique' => 'The :attribute has already been taken.', 88 | 'uploaded' => 'The :attribute failed to upload.', 89 | 'url' => 'The :attribute format is invalid.', 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Custom Validation Language Lines 94 | |-------------------------------------------------------------------------- 95 | | 96 | | Here you may specify custom validation messages for attributes using the 97 | | convention "attribute.rule" to name the lines. This makes it quick to 98 | | specify a specific custom language line for a given attribute rule. 99 | | 100 | */ 101 | 102 | 'custom' => [ 103 | 'attribute-name' => [ 104 | 'rule-name' => 'custom-message', 105 | ], 106 | ], 107 | 108 | /* 109 | |-------------------------------------------------------------------------- 110 | | Custom Validation Attributes 111 | |-------------------------------------------------------------------------- 112 | | 113 | | The following language lines are used to swap attribute place-holders 114 | | with something more reader friendly such as E-Mail Address instead 115 | | of "email". This simply helps us make messages a little cleaner. 116 | | 117 | */ 118 | 119 | 'attributes' => [], 120 | 121 | ]; 122 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Login
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('email')) 21 | 22 | {{ $errors->first('email') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('password')) 35 | 36 | {{ $errors->first('password') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 |
44 |
45 | 48 |
49 |
50 |
51 | 52 |
53 |
54 | 57 | 58 | 59 | Forgot Your Password? 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | @endsection 70 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 |
18 | {{ csrf_field() }} 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @if ($errors->has('email')) 27 | 28 | {{ $errors->first('email') }} 29 | 30 | @endif 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Reset Password
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @if ($errors->has('email')) 23 | 24 | {{ $errors->first('email') }} 25 | 26 | @endif 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @if ($errors->has('password')) 37 | 38 | {{ $errors->first('password') }} 39 | 40 | @endif 41 |
42 |
43 | 44 |
45 | 46 |
47 | 48 | 49 | @if ($errors->has('password_confirmation')) 50 | 51 | {{ $errors->first('password_confirmation') }} 52 | 53 | @endif 54 |
55 |
56 | 57 |
58 |
59 | 62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 | @endsection 71 | -------------------------------------------------------------------------------- /resources/views/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Register
9 | 10 |
11 |
12 | {{ csrf_field() }} 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @if ($errors->has('name')) 21 | 22 | {{ $errors->first('name') }} 23 | 24 | @endif 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @if ($errors->has('email')) 35 | 36 | {{ $errors->first('email') }} 37 | 38 | @endif 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @if ($errors->has('password')) 49 | 50 | {{ $errors->first('password') }} 51 | 52 | @endif 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | @if (session('status')) 12 |
13 | {{ session('status') }} 14 |
15 | @endif 16 | 17 | You are logged in! 18 |
19 |
20 |
21 |
22 |
23 | @endsection 24 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {{ config('app.name', 'Laravel') }} 12 | 13 | 14 | 15 | 16 | 17 |
18 | 73 | 74 | @yield('content') 75 |
76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Laravel 9 | 10 | 11 | 12 | 13 | 14 | 66 | 67 | 68 |
69 | @if (Route::has('login')) 70 | 78 | @endif 79 | 80 |
81 |
82 | Laravel 83 |
84 | 85 | 92 |
93 |
94 | 95 | 96 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 17 | return $request->user(); 18 | }); 19 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 22 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 20 | 21 | $response->assertStatus(200); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | let mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/assets/js/app.js', 'public/js') 15 | .sass('resources/assets/sass/app.scss', 'public/css'); 16 | --------------------------------------------------------------------------------