Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 authored and github-actions[bot] committed Sep 28, 2023
1 parent 2297c69 commit 80d55d1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions database/migrations/2023_09_23_225631_create_audits_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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']);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Spatie\Permission\PermissionRegistrar;

class CreatePermissionTables extends Migration
Expand All @@ -11,6 +11,7 @@ class CreatePermissionTables extends Migration
* Run the migrations.
*
* @return void
*
* @throws Exception
*/
public function up()
Expand Down Expand Up @@ -124,6 +125,7 @@ public function up()
* Reverse the migrations.
*
* @return void
*
* @throws Exception
*/
public function down()
Expand Down
12 changes: 6 additions & 6 deletions database/migrations/2023_09_28_230630_create_teams_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use Illuminate\Support\Facades\Schema;
use Spatie\Permission\PermissionRegistrar;

return new class extends Migration {

return new class extends Migration
{
/**
* Run the migrations.
*/
Expand All @@ -17,7 +17,7 @@ public function up(): void
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');

if (!$teams) {
if (! $teams) {
return;
}

Expand All @@ -42,15 +42,15 @@ public function up(): void
$table->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');
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
});
}

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');

Expand All @@ -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') {
Expand Down
4 changes: 1 addition & 3 deletions src/Http/Middleware/EnsureEmailIsVerified.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Middleware/TeamsPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 80d55d1

Please sign in to comment.