feat: update laravel files

pull/25/head
Al-Amin Firdows 4 years ago
parent 6f270ecb08
commit 79a3acc147

@ -47,6 +47,9 @@ AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID= PUSHER_APP_ID=
PUSHER_APP_KEY= PUSHER_APP_KEY=
PUSHER_APP_SECRET= PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1 PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
@ -56,3 +59,9 @@ SANCTUM_STATEFUL_DOMAINS="localhost,localhost:3000,localhost:8000,127.0.0.1,127.
DEFAULT_ROLE_SLUG=user DEFAULT_ROLE_SLUG=user
DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN=false DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN=false
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

3
.gitattributes vendored

@ -1,4 +1,4 @@
* text=auto * text=auto eol=lf
*.blade.php diff=html *.blade.php diff=html
*.css diff=css *.css diff=css
@ -8,3 +8,4 @@
/.github export-ignore /.github export-ignore
CHANGELOG.md export-ignore CHANGELOG.md export-ignore
.styleci.yml export-ignore

5
.gitignore vendored

@ -1,15 +1,20 @@
/.phpunit.cache
/node_modules /node_modules
/public/build
/public/hot /public/hot
/public/storage /public/storage
/storage/*.key /storage/*.key
/vendor /vendor
.env .env
.env.backup .env.backup
.env.production
.phpunit.result.cache .phpunit.result.cache
Homestead.json Homestead.json
Homestead.yaml Homestead.yaml
auth.json
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
/.fleet
/.idea /.idea
/.vscode /.vscode
database.sqlite database.sqlite

@ -5,23 +5,21 @@ namespace App\Console;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel { class Kernel extends ConsoleKernel
{
/** /**
* Define the application's command schedule. * Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/ */
protected function schedule(Schedule $schedule) { protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly(); // $schedule->command('inspire')->hourly();
} }
/** /**
* Register the commands for the application. * Register the commands for the application.
*
* @return void
*/ */
protected function commands() { protected function commands(): void
{
$this->load(__DIR__.'/Commands'); $this->load(__DIR__.'/Commands');
require base_path('routes/console.php'); require base_path('routes/console.php');

@ -7,7 +7,8 @@ use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Laravel\Sanctum\Exceptions\MissingAbilityException; use Laravel\Sanctum\Exceptions\MissingAbilityException;
use Throwable; use Throwable;
class Handler extends ExceptionHandler { class Handler extends ExceptionHandler
{
/** /**
* A list of exception types with their corresponding custom log levels. * A list of exception types with their corresponding custom log levels.
* *
@ -39,16 +40,16 @@ class Handler extends ExceptionHandler {
/** /**
* Register the exception handling callbacks for the application. * Register the exception handling callbacks for the application.
*
* @return void
*/ */
public function register() { public function register() : void
{
$this->reportable(function (Throwable $e) { $this->reportable(function (Throwable $e) {
// //
}); });
} }
public function render($request, Throwable $exception) { public function render($request, Throwable $exception)
{
if ($exception instanceof ModelNotFoundException) { if ($exception instanceof ModelNotFoundException) {
return response([ return response([
'error' => 1, 'error' => 1,

@ -3,10 +3,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController { class Controller extends BaseController
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; {
use AuthorizesRequests, ValidatesRequests;
} }

@ -4,7 +4,8 @@ namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel { class Kernel extends HttpKernel
{
/** /**
* The application's global HTTP middleware stack. * The application's global HTTP middleware stack.
* *
@ -39,19 +40,19 @@ class Kernel extends HttpKernel {
'api' => [ 'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api', \Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
], ],
]; ];
/** /**
* The application's route middleware. * The application's middleware aliases.
* *
* These middleware may be assigned to groups or used individually. * Aliases may be used to conveniently assign middleware to routes and groups.
* *
* @var array<string, class-string|string> * @var array<string, class-string|string>
*/ */
protected $routeMiddleware = [ protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class, 'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
@ -59,7 +60,7 @@ class Kernel extends HttpKernel {
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
'abilities' => \Laravel\Sanctum\Http\Middleware\CheckAbilities::class, 'abilities' => \Laravel\Sanctum\Http\Middleware\CheckAbilities::class,

@ -3,17 +3,15 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;
class Authenticate extends Middleware { class Authenticate extends Middleware
{
/** /**
* Get the path the user should be redirected to when they are not authenticated. * Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/ */
protected function redirectTo($request) { protected function redirectTo(Request $request): ?string
if (! $request->expectsJson()) { {
return route('login'); return $request->expectsJson() ? null : route('login');
}
} }
} }

@ -4,7 +4,8 @@ namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware { class EncryptCookies extends Middleware
{
/** /**
* The names of the cookies that should not be encrypted. * The names of the cookies that should not be encrypted.
* *

@ -4,7 +4,8 @@ namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware; use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
class PreventRequestsDuringMaintenance extends Middleware { class PreventRequestsDuringMaintenance extends Middleware
{
/** /**
* The URIs that should be reachable while maintenance mode is enabled. * The URIs that should be reachable while maintenance mode is enabled.
* *

@ -6,17 +6,17 @@ use App\Providers\RouteServiceProvider;
use Closure; use Closure;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated { class RedirectIfAuthenticated
{
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
* @param \Illuminate\Http\Request $request * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
*/ */
public function handle(Request $request, Closure $next, ...$guards) { public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards; $guards = empty($guards) ? [null] : $guards;
foreach ($guards as $guard) { foreach ($guards as $guard) {

@ -4,7 +4,8 @@ namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware; use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware { class TrimStrings extends Middleware
{
/** /**
* The names of the attributes that should not be trimmed. * The names of the attributes that should not be trimmed.
* *

@ -4,13 +4,15 @@ namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware; use Illuminate\Http\Middleware\TrustHosts as Middleware;
class TrustHosts extends Middleware { class TrustHosts extends Middleware
{
/** /**
* Get the host patterns that should be trusted. * Get the host patterns that should be trusted.
* *
* @return array<int, string|null> * @return array<int, string|null>
*/ */
public function hosts() { public function hosts(): array
{
return [ return [
$this->allSubdomainsOfApplicationUrl(), $this->allSubdomainsOfApplicationUrl(),
]; ];

@ -5,7 +5,8 @@ namespace App\Http\Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class TrustProxies extends Middleware { class TrustProxies extends Middleware
{
/** /**
* The trusted proxies for this application. * The trusted proxies for this application.
* *

@ -0,0 +1,22 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}

@ -4,7 +4,8 @@ namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware { class VerifyCsrfToken extends Middleware
{
/** /**
* The URIs that should be excluded from CSRF verification. * The URIs that should be excluded from CSRF verification.
* *

@ -4,22 +4,21 @@ namespace App\Providers;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider { class AppServiceProvider extends ServiceProvider
{
/** /**
* Register any application services. * Register any application services.
*
* @return void
*/ */
public function register() { public function register(): void
{
// //
} }
/** /**
* Bootstrap any application services. * Bootstrap any application services.
*
* @return void
*/ */
public function boot() { public function boot(): void
{
// //
} }
} }

@ -4,7 +4,8 @@ namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider { class AuthServiceProvider extends ServiceProvider
{
/** /**
* The model to policy mappings for the application. * The model to policy mappings for the application.
* *
@ -16,12 +17,9 @@ class AuthServiceProvider extends ServiceProvider {
/** /**
* Register any authentication / authorization services. * Register any authentication / authorization services.
*
* @return void
*/ */
public function boot() { public function boot(): void
$this->registerPolicies(); {
// //
} }
} }

@ -5,13 +5,13 @@ namespace App\Providers;
use Illuminate\Support\Facades\Broadcast; use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider { class BroadcastServiceProvider extends ServiceProvider
{
/** /**
* Bootstrap any application services. * Bootstrap any application services.
*
* @return void
*/ */
public function boot() { public function boot(): void
{
Broadcast::routes(); Broadcast::routes();
require base_path('routes/channels.php'); require base_path('routes/channels.php');

@ -7,7 +7,8 @@ use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider { class EventServiceProvider extends ServiceProvider
{
/** /**
* The event to listener mappings for the application. * The event to listener mappings for the application.
* *
@ -21,19 +22,17 @@ class EventServiceProvider extends ServiceProvider {
/** /**
* Register any events for your application. * Register any events for your application.
*
* @return void
*/ */
public function boot() { public function boot(): void
{
// //
} }
/** /**
* Determine if events and listeners should be automatically discovered. * Determine if events and listeners should be automatically discovered.
*
* @return bool
*/ */
public function shouldDiscoverEvents() { public function shouldDiscoverEvents(): bool
{
return false; return false;
} }
} }

@ -8,7 +8,8 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider { class RouteServiceProvider extends ServiceProvider
{
/** /**
* The path to the "home" route for your application. * The path to the "home" route for your application.
* *
@ -20,10 +21,9 @@ class RouteServiceProvider extends ServiceProvider {
/** /**
* Define your route model bindings, pattern filters, and other route configuration. * Define your route model bindings, pattern filters, and other route configuration.
*
* @return void
*/ */
public function boot() { public function boot(): void
{
$this->configureRateLimiting(); $this->configureRateLimiting();
$this->routes(function () { $this->routes(function () {
@ -38,10 +38,9 @@ class RouteServiceProvider extends ServiceProvider {
/** /**
* Configure the rate limiters for the application. * Configure the rate limiters for the application.
*
* @return void
*/ */
protected function configureRateLimiting() { protected function configureRateLimiting(): void
{
RateLimiter::for('api', function (Request $request) { RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
}); });

@ -2,26 +2,23 @@
"name": "laravel/laravel", "name": "laravel/laravel",
"type": "project", "type": "project",
"description": "The Laravel Framework.", "description": "The Laravel Framework.",
"keywords": [ "keywords": ["framework", "laravel"],
"framework",
"laravel"
],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^8.0.2", "php": "^8.1",
"guzzlehttp/guzzle": "^7.4.4", "guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.23", "laravel/framework": "^10.0",
"laravel/sanctum": "^2.15.1", "laravel/sanctum": "^3.2",
"laravel/tinker": "^2.7" "laravel/tinker": "^2.8"
}, },
"require-dev": { "require-dev": {
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.1.0", "laravel/pint": "^1.0",
"laravel/sail": "^1.15", "laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4", "mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.2", "nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^9.5.10", "phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^1.0" "spatie/laravel-ignition": "^2.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -58,8 +55,12 @@
"config": { "config": {
"optimize-autoloader": true, "optimize-autoloader": true,
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true "sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
}, },
"minimum-stability": "dev", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true
} }

@ -80,16 +80,20 @@ return [
| than one user table or model in the application and you want to have | than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types. | separate password reset settings based on the specific user types.
| |
| The expire time is the number of minutes that each reset token will be | The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so | considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed. | they have less time to be guessed. You may change this as needed.
| |
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/ */
'passwords' => [ 'passwords' => [
'users' => [ 'users' => [
'provider' => 'users', 'provider' => 'users',
'table' => 'password_resets', 'table' => 'password_reset_tokens',
'expire' => 60, 'expire' => 60,
'throttle' => 60, 'throttle' => 60,
], ],

@ -36,8 +36,11 @@ return [
'secret' => env('PUSHER_APP_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'), 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'useTLS' => true, 'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
], ],
'client_options' => [ 'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html

@ -38,7 +38,7 @@ return [
'sqlite' => [ 'sqlite' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),
'database' => database_path(env('DB_DATABASE', 'database.sqlite')), 'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '', 'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
], ],

@ -102,6 +102,7 @@ return [
'syslog' => [ 'syslog' => [
'driver' => 'syslog', 'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
], ],
'errorlog' => [ 'errorlog' => [

@ -28,7 +28,7 @@ return [
| sending an e-mail. You will specify which one you are using for your | sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required. | mailers below. You are free to add additional mailers as required.
| |
| Supported: "smtp", "sendmail", "mailgun", "ses", | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover" | "postmark", "log", "array", "failover"
| |
*/ */
@ -51,10 +51,16 @@ return [
'mailgun' => [ 'mailgun' => [
'transport' => 'mailgun', 'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
], ],
'postmark' => [ 'postmark' => [
'transport' => 'postmark', 'transport' => 'postmark',
// 'client' => [
// 'timeout' => 5,
// ],
], ],
'sendmail' => [ 'sendmail' => [

@ -8,16 +8,18 @@ use Illuminate\Support\Str;
/** /**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User> * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/ */
class UserFactory extends Factory { class UserFactory extends Factory
{
/** /**
* Define the model's default state. * Define the model's default state.
* *
* @return array<string, mixed> * @return array<string, mixed>
*/ */
public function definition() { public function definition(): array
{
return [ return [
'name' => $this->faker->name(), 'name' => fake()->name(),
'email' => $this->faker->unique()->safeEmail(), 'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(), 'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10), 'remember_token' => Str::random(10),
@ -26,14 +28,11 @@ class UserFactory extends Factory {
/** /**
* Indicate that the model's email address should be unverified. * Indicate that the model's email address should be unverified.
*
* @return static
*/ */
public function unverified() { public function unverified(): static
return $this->state(function (array $attributes) { {
return [ return $this->state(fn (array $attributes) => [
'email_verified_at' => null, 'email_verified_at' => null,
]; ]);
});
} }
} }

@ -4,13 +4,13 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration { return new class extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() { public function up(): void
{
Schema::create('users', function (Blueprint $table) { Schema::create('users', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name'); $table->string('name');
@ -24,10 +24,9 @@ return new class extends Migration {
/** /**
* Reverse the migrations. * Reverse the migrations.
*
* @return void
*/ */
public function down() { public function down(): void
{
Schema::dropIfExists('users'); Schema::dropIfExists('users');
} }
}; };

@ -4,15 +4,15 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration { return new class extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() { public function up(): void
Schema::create('password_resets', function (Blueprint $table) { {
$table->string('email')->index(); Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token'); $table->string('token');
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
@ -20,10 +20,9 @@ return new class extends Migration {
/** /**
* Reverse the migrations. * Reverse the migrations.
*
* @return void
*/ */
public function down() { public function down(): void
Schema::dropIfExists('password_resets'); {
Schema::dropIfExists('password_reset_tokens');
} }
}; };

@ -4,13 +4,13 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration { return new class extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() { public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) { Schema::create('failed_jobs', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
@ -24,10 +24,9 @@ return new class extends Migration {
/** /**
* Reverse the migrations. * Reverse the migrations.
*
* @return void
*/ */
public function down() { public function down(): void
{
Schema::dropIfExists('failed_jobs'); Schema::dropIfExists('failed_jobs');
} }
}; };

@ -4,13 +4,13 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration { return new class extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*
* @return void
*/ */
public function up() { public function up(): void
{
Schema::create('personal_access_tokens', function (Blueprint $table) { Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id(); $table->id();
$table->morphs('tokenable'); $table->morphs('tokenable');
@ -18,16 +18,16 @@ return new class extends Migration {
$table->string('token', 64)->unique(); $table->string('token', 64)->unique();
$table->text('abilities')->nullable(); $table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable(); $table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
*
* @return void
*/ */
public function down() { public function down(): void
{
Schema::dropIfExists('personal_access_tokens'); Schema::dropIfExists('personal_access_tokens');
} }
}; };

@ -2,21 +2,23 @@
namespace Database\Seeders; namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder { class DatabaseSeeder extends Seeder
{
/** /**
* Seed the application's database. * Seed the application's database.
*
* @return void
*/ */
public function run() { public function run() : void
{
// \App\Models\User::factory(10)->create(); // \App\Models\User::factory(10)->create();
// \App\Models\User::factory()->create([ // \App\Models\User::factory()->create([
// 'name' => 'Test User', // 'name' => 'Test User',
// 'email' => 'test@example.com', // 'email' => 'test@example.com',
// ]); // ]);
$this->call([ $this->call([
RoleSeeder::class, RoleSeeder::class,
UsersSeeder::class, UsersSeeder::class,

@ -1,18 +1,12 @@
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run development", "dev": "vite",
"development": "mix", "build": "vite build"
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.25", "axios": "^1.1.2",
"laravel-mix": "^6.0.6", "laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.19", "vite": "^4.0.0"
"postcss": "^8.1.14"
} }
} }

@ -12,7 +12,7 @@
<directory suffix="Test.php">./tests/Feature</directory> <directory suffix="Test.php">./tests/Feature</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<coverage processUncoveredFiles="true"> <coverage>
<include> <include>
<directory suffix=".php">./app</directory> <directory suffix=".php">./app</directory>
</include> </include>

@ -1,2 +1 @@
require('./bootstrap'); import './bootstrap';

@ -1,13 +1,12 @@
window._ = require('lodash');
/** /**
* We'll load the axios HTTP library which allows us to easily issue requests * We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the * to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie. * CSRF token as a header based on the value of the "XSRF" token cookie.
*/ */
window.axios = require('axios'); import axios from 'axios';
// window.axios.defaults.withCredentials = true; window.axios = axios;
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/** /**
@ -18,11 +17,16 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
// import Echo from 'laravel-echo'; // import Echo from 'laravel-echo';
// window.Pusher = require('pusher-js'); // import Pusher from 'pusher-js';
// window.Pusher = Pusher;
// window.Echo = new Echo({ // window.Echo = new Echo({
// broadcaster: 'pusher', // broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY, // key: import.meta.env.VITE_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER, // cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
// forceTLS: true // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
// enabledTransports: ['ws', 'wss'],
// }); // });

File diff suppressed because one or more lines are too long

@ -13,8 +13,8 @@ use Illuminate\Support\Facades\Route;
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here is where you can register API routes for your application. These | Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which | routes are loaded by the RouteServiceProvider and all of them will
| is assigned the "api" middleware group. Enjoy building your API! | be assigned to the "api" middleware group. Make something great!
| |
*/ */

@ -8,8 +8,8 @@ use Illuminate\Support\Facades\Route;
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here is where you can register web routes for your application. These | Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which | routes are loaded by the RouteServiceProvider and all of them will
| contains the "web" middleware group. Now create something great! | be assigned to the "web" middleware group. Make something great!
| |
*/ */

@ -0,0 +1,11 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
],
});
Loading…
Cancel
Save