- Added services (`RoleService`, `AppRoleService`, `AppsPermissionService`) to handle role creation, app assignments, and permissions. - Introduced new Livewire forms for creating roles and assigning apps (`CreateRoleForm`, `AssignAppToRoleForm`). - Built dynamic Blade views for role and app management, including modals and reusable components. - Removed outdated `fluxui-development` skill documentation.
34 lines
827 B
PHP
34 lines
827 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\ConnectedApp;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class() extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('app_roles', function (Blueprint $table): void {
|
|
$table->id();
|
|
$table->foreignIdFor(ConnectedApp::class, 'app_id');
|
|
$table->foreignId('role_id')->comment('role_id from spatie roles table');
|
|
$table->integer('duration')->comment('in days');
|
|
$table->unique(['app_id', 'role_id']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('app_roles');
|
|
}
|
|
};
|