diff --git a/.editorconfig b/.editorconfig index 1da1dca..730726c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,13 +2,20 @@ root = true [*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true indent_style = space indent_size = 4 -end_of_line = lf -charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true -[*.{json,yml}] +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] indent_style = space indent_size = 2 + +[*.{js,json}] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.env.example b/.env.example index 632b5f6..4b71520 100644 --- a/.env.example +++ b/.env.example @@ -27,7 +27,7 @@ DB_PASSWORD=secret BROADCAST_DRIVER=log CACHE_DRIVER=file -QUEUE_DRIVER=redis +QUEUE_CONNECTION=redis REDIS_HOST=your_project_redis REDIS_PASSWORD=null @@ -40,6 +40,11 @@ MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= @@ -69,7 +74,7 @@ DATA_PATH_HOST=./storage/laradock/ ### PHP ########################################### -# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 7.2 - 7.1 - 7.0 - 5.6 - 5.5 +# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 7.2, 7.3 PHP_VERSION=7.3 # Enable Xdebug diff --git a/.gitignore b/.gitignore index 9dff324..ddc8e99 100644 --- a/.gitignore +++ b/.gitignore @@ -3,20 +3,18 @@ /public/storage /storage/*.key /vendor -/.idea -/.vscode -/.vagrant +.env +.env.backup +.phpunit.result.cache Homestead.json Homestead.yaml npm-debug.log yarn-error.log -.env -composer.lock - +/.idea +/.vscode +/.vagrant .phpstorm* _ide_helper.php - -# mac os -.DS_Store +.DS_Store \ No newline at end of file diff --git a/.styleci.yml b/.styleci.yml index 6c77e9e..ed2b71f 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,15 +1,15 @@ preset: laravel - enabled: - + - alpha_ordered_imports disabled: - length_ordered_imports - - no_unused_imports - - phpdoc_summary - - phpdoc_var_without_name + - unused_use - post_increment - + - phpdoc_summary finder: + not-name: + - index.php + - server.php exclude: - "tests" - "storage" diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index 3e50933..30d3b64 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -2,11 +2,11 @@ namespace App\Http\Controllers\Auth; -use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Models\User; -use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; +use Illuminate\Http\Request; use Specialtactics\L5Api\Http\Controllers\Features\JWTAuthenticationTrait; +use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException; class AuthController extends Controller { diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 5289a7c..571bd55 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers; +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Specialtactics\L5Api\Http\Controllers\RestfulController as BaseController; class Controller extends BaseController diff --git a/app/Http/Controllers/RoleController.php b/app/Http/Controllers/RoleController.php index 0956901..f078ce0 100644 --- a/app/Http/Controllers/RoleController.php +++ b/app/Http/Controllers/RoleController.php @@ -2,8 +2,8 @@ namespace App\Http\Controllers; -use Illuminate\Http\Request; use App\Models\Role; +use Illuminate\Http\Request; class RoleController extends Controller { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8694c29..77008d5 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,11 +14,11 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ + \App\Http\Middleware\TrustProxies::class, \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - \App\Http\Middleware\TrustProxies::class, ]; /** @@ -58,6 +58,7 @@ class Kernel extends HttpKernel 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, @@ -76,6 +77,7 @@ class Kernel extends HttpKernel \Illuminate\Session\Middleware\StartSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\Authenticate::class, + \Illuminate\Routing\Middleware\ThrottleRequests::class, \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Auth\Middleware\Authorize::class, diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 7daf51f..ee5b595 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,15 +2,15 @@ namespace App\Http\Middleware; -use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; +use Illuminate\Http\Request; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * - * @var array + * @var array|string */ protected $proxies; diff --git a/app/Models/User.php b/app/Models/User.php index 933c2a2..80dfd47 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,16 +2,16 @@ namespace App\Models; -use Illuminate\Notifications\Notifiable; +use App\Models\Role; +use Hash; use Illuminate\Auth\Authenticatable; use Illuminate\Auth\Passwords\CanResetPassword; -use Illuminate\Foundation\Auth\Access\Authorizable; -use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; +use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; +use Illuminate\Foundation\Auth\Access\Authorizable; +use Illuminate\Notifications\Notifiable; use Tymon\JWTAuth\Contracts\JWTSubject; -use Hash; -use App\Models\Role; class User extends BaseModel implements AuthenticatableContract, @@ -46,7 +46,7 @@ class User extends BaseModel implements * @var array */ protected $hidden = [ - 'password', 'remember_token', 'primary_role', + 'password', 'remember_token', 'email_verified_at', 'primary_role', ]; /** diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index fe23f5a..72c3913 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,9 +2,9 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; use App\Exceptions\ApiExceptionHandler; use Config; +use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 0acc984..3049068 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Gate; class AuthServiceProvider extends ServiceProvider { diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 352cce4..395c518 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Broadcast; +use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index fca6152..e0bd583 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Event; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { @@ -13,9 +13,7 @@ class EventServiceProvider extends ServiceProvider * @var array */ protected $listen = [ - 'App\Events\Event' => [ - 'App\Listeners\EventListener', - ], + ]; /** diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 372811c..7101879 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { @@ -39,8 +39,6 @@ public function map() $this->mapApiRoutes(); //$this->mapWebRoutes(); - - // } /** diff --git a/app/Providers/TelescopeServiceProvider.php b/app/Providers/TelescopeServiceProvider.php index 945ba08..6d5b5dc 100644 --- a/app/Providers/TelescopeServiceProvider.php +++ b/app/Providers/TelescopeServiceProvider.php @@ -2,9 +2,9 @@ namespace App\Providers; -use Laravel\Telescope\Telescope; use Illuminate\Support\Facades\Gate; use Laravel\Telescope\IncomingEntry; +use Laravel\Telescope\Telescope; use Laravel\Telescope\TelescopeApplicationServiceProvider; class TelescopeServiceProvider extends TelescopeApplicationServiceProvider diff --git a/composer.json b/composer.json index 6b59ba5..bfde5b9 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "specialtactics/l5-api-boilerplate", - "description": "An API boilerplate for Laravel 5", + "name": "specialtactics/laravel-api-boilerplate", + "description": "An API boilerplate for Laravel", "keywords": ["laravel", "boilerplate", "api", "api boilerplate", "laravel api"], "license": "MIT", "type": "project", @@ -11,22 +11,21 @@ } ], "require": { - "php": "^7.1.3", + "php": "^7.2", "fideloper/proxy": "^4.0", - "laravel/framework": "5.8.*", + "laravel/framework": "^6", "laravel/tinker": "^1.0", - "specialtactics/l5-api": "~1", - "predis/predis": "^1.1" + "specialtactics/l5-api": "^1.1" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.4", "beyondcode/laravel-dump-server": "^1.0", - "filp/whoops": "^2.0", + "facade/ignition": "^1.4", "fzaninotto/faker": "^1.4", - "laravel/telescope": "~2.0", + "laravel/telescope": "^2", "mockery/mockery": "^1.0", "nunomaduro/collision": "^3.0", - "phpunit/phpunit": "^7.5" + "phpunit/phpunit": "^8.3" }, "config": { "optimize-autoloader": true, diff --git a/config/auth.php b/config/auth.php index 966d5ed..a999082 100644 --- a/config/auth.php +++ b/config/auth.php @@ -44,6 +44,7 @@ 'api' => [ 'driver' => 'jwt', 'provider' => 'users', + 'hash' => false, ], ], @@ -99,4 +100,17 @@ ], ], + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + ]; diff --git a/config/broadcasting.php b/config/broadcasting.php index 3ca45ea..3bba110 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -37,7 +37,7 @@ 'app_id' => env('PUSHER_APP_ID'), 'options' => [ 'cluster' => env('PUSHER_APP_CLUSTER'), - 'encrypted' => true, + 'useTLS' => true, ], ], diff --git a/config/cache.php b/config/cache.php index 30f0cae..46751e6 100644 --- a/config/cache.php +++ b/config/cache.php @@ -82,6 +82,7 @@ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), ], ], diff --git a/config/database.php b/config/database.php index 49ec59a..199382d 100644 --- a/config/database.php +++ b/config/database.php @@ -1,5 +1,7 @@ [ 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), 'database' => env('DB_DATABASE', database_path('database.sqlite')), 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), @@ -42,6 +45,7 @@ 'mysql' => [ 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'forge'), @@ -61,6 +65,7 @@ 'pgsql' => [ 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), @@ -75,6 +80,7 @@ 'sqlsrv' => [ 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '1433'), 'database' => env('DB_DATABASE', 'forge'), @@ -113,13 +119,15 @@ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'predis'), + 'client' => env('REDIS_CLIENT', 'phpredis'), 'options' => [ - 'cluster' => env('REDIS_CLUSTER', 'predis'), + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ + 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), @@ -127,6 +135,7 @@ ], 'cache' => [ + 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), diff --git a/config/filesystems.php b/config/filesystems.php index 77fa5de..ec6a7ce 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -37,7 +37,7 @@ | may even configure multiple disks of the same driver. Defaults have | been setup for each driver as an example of the required options. | - | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" + | Supported Drivers: "local", "ftp", "sftp", "s3" | */ diff --git a/config/logging.php b/config/logging.php index d09cd7d..0df8212 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,6 @@ 'errorlog', 'level' => 'debug', ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], ], ]; diff --git a/config/mail.php b/config/mail.php index 6f8469f..3c65eb3 100644 --- a/config/mail.php +++ b/config/mail.php @@ -11,8 +11,8 @@ | sending of e-mail. You may specify which one you're using throughout | your application here. By default, Laravel is setup for SMTP mail. | - | Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses", - | "sparkpost", "postmark", "log", "array" + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" | */ diff --git a/config/queue.php b/config/queue.php index 07c7d2a..3a30d6c 100644 --- a/config/queue.php +++ b/config/queue.php @@ -80,6 +80,7 @@ */ 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], diff --git a/config/services.php b/config/services.php index f026b2c..2a1d616 100644 --- a/config/services.php +++ b/config/services.php @@ -8,9 +8,9 @@ |-------------------------------------------------------------------------- | | This file is for storing the credentials for third party services such - | as Stripe, Mailgun, SparkPost and others. This file provides a sane - | default location for this type of information, allowing packages - | to have a conventional place to find your various credentials. + | as Mailgun, Postmark, AWS and more. This file provides the de facto + | location for this type of information, allowing packages to have + | a conventional file to locate the various service credentials. | */ @@ -30,18 +30,4 @@ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - 'sparkpost' => [ - 'secret' => env('SPARKPOST_SECRET'), - ], - - 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), - 'secret' => env('STRIPE_SECRET'), - 'webhook' => [ - 'secret' => env('STRIPE_WEBHOOK_SECRET'), - 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), - ], - ], - ]; diff --git a/config/telescope.php b/config/telescope.php index 9cc039e..187e789 100644 --- a/config/telescope.php +++ b/config/telescope.php @@ -1,7 +1,7 @@ define(App\Models\User::class, function (Faker $faker) { +$factory->define(User::class, function (Faker $faker) { return [ 'name' => $faker->name, 'email' => $faker->unique()->safeEmail, - 'password' => 'secret', - 'remember_token' => str_random(10), + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token' => Str::random(10), ]; }); diff --git a/database/migrations/2018_04_30_000000_create_roles_table.php b/database/migrations/2018_04_30_000000_create_roles_table.php index 4ba9298..d724099 100644 --- a/database/migrations/2018_04_30_000000_create_roles_table.php +++ b/database/migrations/2018_04_30_000000_create_roles_table.php @@ -1,8 +1,8 @@ string('name'); $table->string('email')->unique(); + $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->uuid('primary_role')->nullable(); diff --git a/database/migrations/2018_04_30_000011_create_password_resets_table.php b/database/migrations/2018_04_30_000011_create_password_resets_table.php index bf51686..e5d0aa3 100644 --- a/database/migrations/2018_04_30_000011_create_password_resets_table.php +++ b/database/migrations/2018_04_30_000011_create_password_resets_table.php @@ -1,8 +1,8 @@ bigIncrements('id'); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('failed_jobs'); + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 375b045..ecf0c6c 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -5,7 +5,7 @@ class DatabaseSeeder extends Seeder { /** - * Run the database seeds. + * Seed the application's database. * * @return void */ diff --git a/env/docker/php-fpm/Dockerfile b/env/docker/php-fpm/Dockerfile index 9552e05..76e446d 100644 --- a/env/docker/php-fpm/Dockerfile +++ b/env/docker/php-fpm/Dockerfile @@ -30,6 +30,14 @@ RUN docker-php-ext-install json && \ docker-php-ext-install bcmath && \ docker-php-ext-install sockets +# Install required PECL extensions +RUN pecl install \ + redis + +# Enable above +RUN docker-php-ext-enable \ + redis + ########################################################################### # xDebug: ########################################################################### diff --git a/env/docker/workspace/Dockerfile b/env/docker/workspace/Dockerfile index dcb6cad..0600788 100644 --- a/env/docker/workspace/Dockerfile +++ b/env/docker/workspace/Dockerfile @@ -42,6 +42,14 @@ RUN docker-php-ext-install json && \ docker-php-ext-install bcmath && \ docker-php-ext-install sockets +# Install required PECL extensions +RUN pecl install \ + redis + +# Enable above +RUN docker-php-ext-enable \ + redis + ########################################################################### # Laradock non-root user: ########################################################################### diff --git a/phpunit.xml b/phpunit.xml index 5f237af..7d83ad9 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -30,12 +30,12 @@ - - - - - - - + + + + + + + diff --git a/public/index.php b/public/index.php index e196467..4584cbc 100644 --- a/public/index.php +++ b/public/index.php @@ -3,8 +3,10 @@ /** * Laravel - A PHP Framework For Web Artisans * + * @package Laravel * @author Taylor Otwell */ + define('LARAVEL_START', microtime(true)); /* diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index bf6caf6..f3b01a4 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -13,7 +13,6 @@ | */ - 'password' => 'Passwords must be at least eight characters and match the confirmation.', 'reset' => 'Your password has been reset!', 'sent' => 'We have e-mailed your password reset link!', 'token' => 'This password reset token is invalid.', diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index 8ab929c..ce1d80d 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -40,6 +40,7 @@ 'dimensions' => 'The :attribute has invalid image dimensions.', 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', + 'ends_with' => 'The :attribute must end with one of the following: :values', 'exists' => 'The selected :attribute is invalid.', 'file' => 'The :attribute must be a file.', 'filled' => 'The :attribute field must have a value.', @@ -92,6 +93,7 @@ 'not_in' => 'The selected :attribute is invalid.', 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', + 'password' => 'The password is incorrect.', 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php deleted file mode 100644 index 471513d..0000000 --- a/resources/views/welcome.blade.php +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - Laravel - - - - - - - - -
- @if (Route::has('login')) - - @endif - -
-
- Laravel -
- - -
-
- - diff --git a/routes/api.php b/routes/api.php index 387ad98..c56bf3e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,5 +1,6 @@ get('/user', function (Request $request) { - return $request->user(); -}); - /* * Welcome route - link to any public API documentation here */ @@ -24,16 +21,14 @@ echo 'Welcome to our API'; }); -/** - * @var $api \Dingo\Api\Routing\Router - */ +/** @var \Dingo\Api\Routing\Router $api */ $api = app('Dingo\Api\Routing\Router'); -$api->version('v1', ['middleware' => ['api']], function ($api) { +$api->version('v1', ['middleware' => ['api']], function (Router $api) { /* * Authentication */ - $api->group(['prefix' => 'auth'], function ($api) { - $api->group(['prefix' => 'jwt'], function ($api) { + $api->group(['prefix' => 'auth'], function (Router $api) { + $api->group(['prefix' => 'jwt'], function (Router $api) { $api->get('/token', 'App\Http\Controllers\Auth\AuthController@token'); }); }); @@ -41,12 +36,12 @@ /* * Authenticated routes */ - $api->group(['middleware' => ['api.auth']], function ($api) { + $api->group(['middleware' => ['api.auth']], function (Router $api) { /* * Authentication */ - $api->group(['prefix' => 'auth'], function ($api) { - $api->group(['prefix' => 'jwt'], function ($api) { + $api->group(['prefix' => 'auth'], function (Router $api) { + $api->group(['prefix' => 'jwt'], function (Router $api) { $api->get('/refresh', 'App\Http\Controllers\Auth\AuthController@refresh'); $api->delete('/token', 'App\Http\Controllers\Auth\AuthController@logout'); }); @@ -57,7 +52,7 @@ /* * Users */ - $api->group(['prefix' => 'users', 'middleware' => 'check_role:admin'], function ($api) { + $api->group(['prefix' => 'users', 'middleware' => 'check_role:admin'], function (Router $api) { $api->get('/', 'App\Http\Controllers\UserController@getAll'); $api->get('/{uuid}', 'App\Http\Controllers\UserController@get'); $api->post('/', 'App\Http\Controllers\UserController@post'); @@ -69,7 +64,7 @@ /* * Roles */ - $api->group(['prefix' => 'roles'], function ($api) { + $api->group(['prefix' => 'roles'], function (Router $api) { $api->get('/', 'App\Http\Controllers\RoleController@getAll'); }); }); diff --git a/server.php b/server.php index b07fa44..5fb6379 100644 --- a/server.php +++ b/server.php @@ -3,8 +3,10 @@ /** * Laravel - A PHP Framework For Web Artisans * + * @package Laravel * @author Taylor Otwell */ + $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index f31e495..cdb5111 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class ExampleTest extends TestCase { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c..266ef35 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,8 +2,8 @@ namespace Tests\Unit; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class ExampleTest extends TestCase {