diff --git a/database/migrations/2023_09_23_225631_create_audits_table.php b/database/migrations/2023_09_23_225631_create_audits_table.php index befd47e..b232e1a 100644 --- a/database/migrations/2023_09_23_225631_create_audits_table.php +++ b/database/migrations/2023_09_23_225631_create_audits_table.php @@ -21,8 +21,8 @@ public function up() $morphPrefix = config('audit.user.morph_prefix', 'user'); $table->bigIncrements('id'); - $table->string($morphPrefix . '_type')->nullable(); - $table->unsignedBigInteger($morphPrefix . '_id')->nullable(); + $table->string($morphPrefix.'_type')->nullable(); + $table->unsignedBigInteger($morphPrefix.'_id')->nullable(); $table->string('event'); $table->morphs('auditable'); $table->text('old_values')->nullable(); @@ -33,7 +33,7 @@ public function up() $table->string('tags')->nullable(); $table->timestamps(); - $table->index([$morphPrefix . '_id', $morphPrefix . '_type']); + $table->index([$morphPrefix.'_id', $morphPrefix.'_type']); }); } diff --git a/database/migrations/2023_09_28_224955_create_permission_tables.php b/database/migrations/2023_09_28_224955_create_permission_tables.php index 115f16b..29a1d3b 100644 --- a/database/migrations/2023_09_28_224955_create_permission_tables.php +++ b/database/migrations/2023_09_28_224955_create_permission_tables.php @@ -1,8 +1,8 @@ timestamp('restored_at')->nullable(); }); - if (!Schema::hasColumn($tableNames['roles'], $columnNames['team_foreign_key'])) { + if (! Schema::hasColumn($tableNames['roles'], $columnNames['team_foreign_key'])) { Schema::table($tableNames['roles'], function (Blueprint $table) use ($columnNames) { $table->foreignId($columnNames['team_foreign_key'])->nullable()->after('id'); $table->dropUnique('roles_name_guard_name_unique'); @@ -50,7 +50,7 @@ public function up(): void }); } - if (!Schema::hasColumn($tableNames['model_has_permissions'], $columnNames['team_foreign_key'])) { + if (! Schema::hasColumn($tableNames['model_has_permissions'], $columnNames['team_foreign_key'])) { Schema::table($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { $table->foreignId($columnNames['team_foreign_key'])->default('1'); @@ -67,7 +67,7 @@ public function up(): void }); } - if (!Schema::hasColumn($tableNames['model_has_roles'], $columnNames['team_foreign_key'])) { + if (! Schema::hasColumn($tableNames['model_has_roles'], $columnNames['team_foreign_key'])) { Schema::table($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { $table->foreignId($columnNames['team_foreign_key'])->default('1'); if (DB::getDriverName() !== 'sqlite') { diff --git a/src/Http/Middleware/EnsureEmailIsVerified.php b/src/Http/Middleware/EnsureEmailIsVerified.php index 3989941..94a1103 100644 --- a/src/Http/Middleware/EnsureEmailIsVerified.php +++ b/src/Http/Middleware/EnsureEmailIsVerified.php @@ -12,9 +12,7 @@ class EnsureEmailIsVerified /** * Handle an incoming request. * - * @param Request $request - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next - * @return Response + * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { diff --git a/src/Http/Middleware/TeamsPermission.php b/src/Http/Middleware/TeamsPermission.php index 7a0d652..5494a33 100644 --- a/src/Http/Middleware/TeamsPermission.php +++ b/src/Http/Middleware/TeamsPermission.php @@ -10,13 +10,13 @@ class TeamsPermission /** * Handle an incoming request. * - * @param Request $request - * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next + * @param Request $request + * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next * @return Response */ public function handle($request, \Closure $next) { - if (!empty(auth('api')->user())) { + if (! empty(auth('api')->user())) { setPermissionsTeamId(auth('api')->user()->getTeamIdFromToken()); }