Skip to content

Commit

Permalink
Pint
Browse files Browse the repository at this point in the history
  • Loading branch information
NatachaH committed Jan 19, 2023
1 parent 825cb6c commit 0d33d72
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 27 deletions.
11 changes: 4 additions & 7 deletions config/access-control.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

'guarded' => ['superadmin'],


/*
|--------------------------------------------------------------------------
| Protected
Expand All @@ -43,8 +42,7 @@
| Here you may specify the roles that are protected (to use in policies)
*/

'protected' => ['superadmin','admin'],

'protected' => ['superadmin', 'admin'],

/*
|--------------------------------------------------------------------------
Expand All @@ -54,7 +52,7 @@
| Here you may specify the roles that have the guard protected (in case of hasRoles() you should avoid the update of the role guard)
*/

'guard-protected' => ['superadmin','admin'],
'guard-protected' => ['superadmin', 'admin'],

/*
|--------------------------------------------------------------------------
Expand All @@ -65,8 +63,7 @@
*/

'permissions' => [
'actions' => ['view','create','update','delete','restore','force-delete']
]

'actions' => ['view', 'create', 'update', 'delete', 'restore', 'force-delete'],
],

];
4 changes: 2 additions & 2 deletions database/migrations/2020_04_10_000001_create_roles_table.php
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;

class CreateRolesTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?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;

class CreatePermissionsTable extends Migration
{

/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permissions', function (Blueprint $table)
{
Schema::create('permissions', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->unique();
$table->string('model')->nullable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

class CreatePermissionRoleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
/**
* Run the migrations.
*
* @return void
*/
Schema::create('permission_role', function (Blueprint $table) {
$table->bigInteger('permission_id')->unsigned();
$table->bigInteger('role_id')->unsigned();
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;

class AddColumn{{ UCPNAME }}RoleTable extends Migration
{
Expand All @@ -13,8 +13,7 @@ class AddColumn{{ UCPNAME }}RoleTable extends Migration
*/
public function up()
{
Schema::table('{{ PNAME }}', function (Blueprint $table)
{
Schema::table('{{ PNAME }}', function (Blueprint $table) {
$table->bigInteger('role_id')->after('id')->unsigned()->nullable();
$table->foreign('role_id')
->references('id')
Expand All @@ -30,8 +29,7 @@ public function up()
*/
public function down()
{
Schema::table('{{ PNAME }}', function (Blueprint $table)
{
Schema::table('{{ PNAME }}', function (Blueprint $table) {
$table->dropForeign(['role_id']);
$table->dropColumn('role_id');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class CreateRoleablesTable extends Migration
*/
public function up()
{
Schema::create('roleables', function (Blueprint $table)
{
Schema::create('roleables', function (Blueprint $table) {
$table->id();
$table->bigInteger('role_id')->unsigned();
$table->morphs('roleable');
Expand Down

0 comments on commit 0d33d72

Please sign in to comment.