Merge branch 'master' of https://bitbucket.org/FlavioBarachino/bubofamily
upgrade del server di produzione
This commit is contained in:
commit
9f7bd629af
@ -10,7 +10,7 @@ class Manutenzione extends Model
|
|||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
public static function saveRevisione($id,$data)
|
public static function saveManutenzione($id,$data)
|
||||||
{
|
{
|
||||||
DB::table('manutenziones')->insert([
|
DB::table('manutenziones')->insert([
|
||||||
'fk_operazione_id'=>$id,
|
'fk_operazione_id'=>$id,
|
||||||
|
@ -9,11 +9,12 @@ use Illuminate\Notifications\Notifiable;
|
|||||||
use Laravel\Sanctum\HasApiTokens;
|
use Laravel\Sanctum\HasApiTokens;
|
||||||
//use LdapRecord\Laravel\Auth\Authenticatable;
|
//use LdapRecord\Laravel\Auth\Authenticatable;
|
||||||
use LdapRecord\Laravel\Auth\AuthenticatesWithLdap;
|
use LdapRecord\Laravel\Auth\AuthenticatesWithLdap;
|
||||||
|
use Junges\ACL\Concerns\HasGroups;
|
||||||
|
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap;
|
use HasApiTokens, HasFactory, Notifiable, AuthenticateswithLdap, HasGroups;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
"laravel/tinker": "^2.5",
|
"laravel/tinker": "^2.5",
|
||||||
"laravel/ui": "^3.4",
|
"laravel/ui": "^3.4",
|
||||||
"laraveldaily/laravel-charts": "^0.1.29",
|
"laraveldaily/laravel-charts": "^0.1.29",
|
||||||
|
"mateusjunges/laravel-acl": "^4.2",
|
||||||
"rap2hpoutre/fast-excel": "^3.2",
|
"rap2hpoutre/fast-excel": "^3.2",
|
||||||
"secondtruth/startmin": "^1.1",
|
"secondtruth/startmin": "^1.1",
|
||||||
"sfneal/view-export": "^2.10",
|
"sfneal/view-export": "^2.10",
|
||||||
|
191
composer.lock
generated
191
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "0f5a22e06d42bf673cc91f814328d245",
|
"content-hash": "54f5d58038210c158e2f6aa9ddac0439",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asm89/stack-cors",
|
"name": "asm89/stack-cors",
|
||||||
@ -1133,6 +1133,59 @@
|
|||||||
},
|
},
|
||||||
"time": "2022-09-18T07:06:19+00:00"
|
"time": "2022-09-18T07:06:19+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "facade/ignition-contracts",
|
||||||
|
"version": "1.0.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/facade/ignition-contracts.git",
|
||||||
|
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
|
||||||
|
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^v2.15.8",
|
||||||
|
"phpunit/phpunit": "^9.3.11",
|
||||||
|
"vimeo/psalm": "^3.17.1"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Facade\\IgnitionContracts\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Freek Van der Herten",
|
||||||
|
"email": "freek@spatie.be",
|
||||||
|
"homepage": "https://flareapp.io",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Solution contracts for Ignition",
|
||||||
|
"homepage": "https://github.com/facade/ignition-contracts",
|
||||||
|
"keywords": [
|
||||||
|
"contracts",
|
||||||
|
"flare",
|
||||||
|
"ignition"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/facade/ignition-contracts/issues",
|
||||||
|
"source": "https://github.com/facade/ignition-contracts/tree/1.0.2"
|
||||||
|
},
|
||||||
|
"time": "2020-10-16T08:27:54+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "fruitcake/laravel-cors",
|
"name": "fruitcake/laravel-cors",
|
||||||
"version": "v2.2.0",
|
"version": "v2.2.0",
|
||||||
@ -2880,6 +2933,89 @@
|
|||||||
},
|
},
|
||||||
"time": "2022-08-18T16:18:26+00:00"
|
"time": "2022-08-18T16:18:26+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mateusjunges/laravel-acl",
|
||||||
|
"version": "v4.2.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mateusjunges/laravel-acl.git",
|
||||||
|
"reference": "d4d41b897002218e11d6826e5b021ff4935ec19d"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/mateusjunges/laravel-acl/zipball/d4d41b897002218e11d6826e5b021ff4935ec19d",
|
||||||
|
"reference": "d4d41b897002218e11d6826e5b021ff4935ec19d",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"facade/ignition-contracts": "^1.0",
|
||||||
|
"illuminate/auth": "^8.0|^9.0",
|
||||||
|
"illuminate/container": "^8.0|^9.0",
|
||||||
|
"illuminate/database": "^8.0|^9.0",
|
||||||
|
"illuminate/support": "^8.0|^9.0",
|
||||||
|
"php": "^7.4|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.4",
|
||||||
|
"orchestra/testbench": "^6.0|^7.0",
|
||||||
|
"phpunit/phpunit": "^9.4",
|
||||||
|
"predis/predis": "^1.1"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"facade/igntion": "Needed to be able to use the ignition solutions for laravel-acl"
|
||||||
|
},
|
||||||
|
"type": "laravel-package",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Junges\\ACL\\Providers\\ACLServiceProvider",
|
||||||
|
"Junges\\ACL\\Providers\\ACLAuthServiceProvider",
|
||||||
|
"Junges\\ACL\\Providers\\ACLEventsServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/helpers.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Junges\\ACL\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Mateus Junges",
|
||||||
|
"email": "mateus@junges.dev",
|
||||||
|
"homepage": "https://twitter.com/mateusjungess",
|
||||||
|
"role": "Backend Software Engineer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "This package provides a complete Access Control List management",
|
||||||
|
"homepage": "https://github.com/mateusjunges/laravel-acl",
|
||||||
|
"keywords": [
|
||||||
|
"access-control-list",
|
||||||
|
"acl",
|
||||||
|
"junges",
|
||||||
|
"laravel",
|
||||||
|
"permissions",
|
||||||
|
"security"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/mateusjunges/laravel-acl/issues",
|
||||||
|
"source": "https://github.com/mateusjunges/laravel-acl"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/mateusjunges",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2022-12-15T02:50:22+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
"version": "2.9.1",
|
"version": "2.9.1",
|
||||||
@ -8495,59 +8631,6 @@
|
|||||||
},
|
},
|
||||||
"time": "2023-01-26T12:34:59+00:00"
|
"time": "2023-01-26T12:34:59+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "facade/ignition-contracts",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/facade/ignition-contracts.git",
|
|
||||||
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
|
|
||||||
"reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": "^7.3|^8.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"friendsofphp/php-cs-fixer": "^v2.15.8",
|
|
||||||
"phpunit/phpunit": "^9.3.11",
|
|
||||||
"vimeo/psalm": "^3.17.1"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Facade\\IgnitionContracts\\": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Freek Van der Herten",
|
|
||||||
"email": "freek@spatie.be",
|
|
||||||
"homepage": "https://flareapp.io",
|
|
||||||
"role": "Developer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Solution contracts for Ignition",
|
|
||||||
"homepage": "https://github.com/facade/ignition-contracts",
|
|
||||||
"keywords": [
|
|
||||||
"contracts",
|
|
||||||
"flare",
|
|
||||||
"ignition"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/facade/ignition-contracts/issues",
|
|
||||||
"source": "https://github.com/facade/ignition-contracts/tree/1.0.2"
|
|
||||||
},
|
|
||||||
"time": "2020-10-16T08:27:54+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "fakerphp/faker",
|
"name": "fakerphp/faker",
|
||||||
"version": "v1.21.0",
|
"version": "v1.21.0",
|
||||||
|
106
config/acl.php
Normal file
106
config/acl.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Models
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| When using this package, we need to know which Eloquent Model should be used
|
||||||
|
| to retrieve your groups and permissions. Of course, it is just the basics models
|
||||||
|
| needed, but you can use whatever you like.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'models' => [
|
||||||
|
/*
|
||||||
|
| The model you want to use as Permission model must use the MateusJunges\ACL\Traits\PermissionsTrait
|
||||||
|
*/
|
||||||
|
'permission' => Junges\ACL\Models\Permission::class,
|
||||||
|
|
||||||
|
/*
|
||||||
|
| The model you want to use as Group model must use the MateusJunges\ACL\Traits\GroupsTrait
|
||||||
|
*/
|
||||||
|
'group' => Junges\ACL\Models\Group::class,
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Route Model Binding
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| If you would like model binding to use a database column other than id when
|
||||||
|
| retrieving a given model class, you may override the getRouteKeyName method
|
||||||
|
| on the Eloquent model with yours. The default key used for route model binding
|
||||||
|
| in this package is the `id` database column. You can modify it by changing the
|
||||||
|
| following configuration:
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'route_model_binding_keys' => [
|
||||||
|
'group_model' => 'id',
|
||||||
|
'permission_model' => 'id',
|
||||||
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Tables
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Specify the basics authentication tables that you are using.
|
||||||
|
| Once you required this package, the following tables are
|
||||||
|
| created by default when you run the command
|
||||||
|
|
|
||||||
|
| php artisan migrate
|
||||||
|
|
|
||||||
|
| If you want to change this tables, please keep the basic structure unchanged.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'tables' => [
|
||||||
|
'groups' => 'groups',
|
||||||
|
'permissions' => 'permissions',
|
||||||
|
'users' => 'users',
|
||||||
|
'group_has_permissions' => 'group_has_permissions',
|
||||||
|
'model_has_permissions' => 'model_has_permissions',
|
||||||
|
'model_has_groups' => 'model_has_groups',
|
||||||
|
],
|
||||||
|
|
||||||
|
'column_names' => [
|
||||||
|
'group_pivot_key' => null,
|
||||||
|
'permission_pivot_key' => null,
|
||||||
|
'model_morph_key' => 'model_id',
|
||||||
|
'team_foreign_key' => 'team_id'
|
||||||
|
],
|
||||||
|
|
||||||
|
'teams' => false,
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Ignition Solution Suggestions
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| To enable the ignition solutions for laravel-acl, set this flag to true.
|
||||||
|
|
|
||||||
|
| The solutions will then be automatically registered with ignition if its installed.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
'offer_solutions' => false,
|
||||||
|
|
||||||
|
'register_permission_check_method' => true,
|
||||||
|
|
||||||
|
'cache' => [
|
||||||
|
/*
|
||||||
|
* All permissions are cached for 24 hours by default. If permissions or groups are updated,
|
||||||
|
* then the cache is flushed automatically.
|
||||||
|
*/
|
||||||
|
'expiration_time' => DateInterval::createFromDateString('24 hours'),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The cache key used to store permissions.
|
||||||
|
*/
|
||||||
|
'key' => 'junges.acl.cache',
|
||||||
|
|
||||||
|
/*
|
||||||
|
* You can optionally specify a cache driver to use for permissions caching using
|
||||||
|
* store drivers listed in config/cache.php.
|
||||||
|
*/
|
||||||
|
'store' => 'default'
|
||||||
|
]
|
||||||
|
];
|
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreatePermissionsTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$permissionsTable = config('acl.tables.permissions', 'permissions');
|
||||||
|
Schema::create($permissionsTable, function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('guard_name');
|
||||||
|
$table->text('description')->nullable();
|
||||||
|
$table->softDeletes();
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
$table->unique(['name', 'guard_name']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$tables = config('acl.tables');
|
||||||
|
Schema::dropIfExists($tables['permissions']);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateGroupsTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$groupsTable = config('acl.tables.groups', 'groups');
|
||||||
|
$teams = config('acl.teams');
|
||||||
|
$columnNames = config('acl.column_names');
|
||||||
|
|
||||||
|
Schema::create($groupsTable, function (Blueprint $table) use ($teams, $columnNames) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
|
||||||
|
if ($teams || config("acl.testing")) {
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'groups_team_foreign_key_index');
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('guard_name');
|
||||||
|
$table->text('description')->nullable();
|
||||||
|
$table->softDeletes();
|
||||||
|
$table->timestamps();
|
||||||
|
|
||||||
|
if ($teams || config('acl.testing')) {
|
||||||
|
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
|
||||||
|
} else {
|
||||||
|
$table->unique(['name', 'guard_name']);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$groupsTable = config('acl.tables.groups', 'groups');
|
||||||
|
Schema::dropIfExists($groupsTable);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Junges\ACL\AclRegistrar;
|
||||||
|
|
||||||
|
class CreateModelHasPermissionsTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$columnNames = config('acl.column_names');
|
||||||
|
|
||||||
|
$modelHasPermissions = config('acl.tables.model_has_permissions', 'model_has_permissions');
|
||||||
|
$permissionsTable = config('acl.tables.permissions', 'permissions');
|
||||||
|
$teams = config('acl.teams');
|
||||||
|
|
||||||
|
Schema::create($modelHasPermissions, function (Blueprint $table) use ($permissionsTable, $columnNames, $teams) {
|
||||||
|
$table->unsignedBigInteger(AclRegistrar::$pivotPermission);
|
||||||
|
$table->string('model_type');
|
||||||
|
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||||
|
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_id_model_type_index');
|
||||||
|
|
||||||
|
$table->foreign(AclRegistrar::$pivotPermission)
|
||||||
|
->references('id')
|
||||||
|
->on($permissionsTable)
|
||||||
|
->cascadeOnDelete();
|
||||||
|
|
||||||
|
if ($teams) {
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index');
|
||||||
|
|
||||||
|
$table->primary([$columnNames['team_foreign_key'], AclRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([AclRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_permissions_permission_model_type_primary');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$modelHasPermissionTable = config('acl.tables.model_has_permissions', 'model_has_permissions');
|
||||||
|
Schema::dropIfExists($modelHasPermissionTable);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Junges\ACL\AclRegistrar;
|
||||||
|
|
||||||
|
class CreateModelHasGroupsTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$columnNames = config('acl.column_names');
|
||||||
|
$modelHasGroups = config('acl.tables.model_has_groups', 'model_has_groups');
|
||||||
|
$groupsTable = config('acl.tables.groups', 'groups');
|
||||||
|
$teams = config('acl.teams');
|
||||||
|
|
||||||
|
Schema::create($modelHasGroups, function (Blueprint $table) use ($groupsTable, $columnNames, $teams) {
|
||||||
|
$table->unsignedBigInteger(AclRegistrar::$pivotGroup);
|
||||||
|
|
||||||
|
$table->string('model_type');
|
||||||
|
$table->unsignedBigInteger($columnNames['model_morph_key']);
|
||||||
|
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_groups_model_id_model_type_index');
|
||||||
|
|
||||||
|
$table->foreign(AclRegistrar::$pivotGroup)
|
||||||
|
->references('id')
|
||||||
|
->on($groupsTable)
|
||||||
|
->cascadeOnDelete();
|
||||||
|
|
||||||
|
if ($teams) {
|
||||||
|
$table->unsignedBigInteger($columnNames['team_foreign_key']);
|
||||||
|
$table->index($columnNames['team_foreign_key'], 'model_has_groups_team_foreign_key_index');
|
||||||
|
|
||||||
|
$table->primary([$columnNames['team_foreign_key'], AclRegistrar::$pivotGroup, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_groups_group_model_type_primary');
|
||||||
|
} else {
|
||||||
|
$table->primary([AclRegistrar::$pivotGroup, $columnNames['model_morph_key'], 'model_type'],
|
||||||
|
'model_has_groups_group_model_type_primary');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$modelHasGroupsTable = config('acl.tables.model_has_groups', 'model_has_groups');
|
||||||
|
Schema::dropIfExists($modelHasGroupsTable);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Junges\ACL\AclRegistrar;
|
||||||
|
|
||||||
|
class CreateGroupHasPermissionsTable extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$groupHasPermissionTable = config('acl.tables.group_has_permissions', 'group_has_permissions');
|
||||||
|
$groupsTable = config('acl.tables.groups', 'groups');
|
||||||
|
$permissionsTable = config('acl.tables.permissions', 'permissions');
|
||||||
|
|
||||||
|
Schema::create($groupHasPermissionTable, function (Blueprint $table) use ($groupsTable, $permissionsTable) {
|
||||||
|
$table->unsignedBigInteger(AclRegistrar::$pivotPermission);
|
||||||
|
$table->unsignedBigInteger(AclRegistrar::$pivotGroup);
|
||||||
|
|
||||||
|
$table->foreign(AclRegistrar::$pivotPermission)
|
||||||
|
->references('id')
|
||||||
|
->on($permissionsTable)
|
||||||
|
->cascadeOnDelete();
|
||||||
|
|
||||||
|
$table->foreign(AclRegistrar::$pivotGroup)
|
||||||
|
->references('id')
|
||||||
|
->on($groupsTable)
|
||||||
|
->cascadeOnDelete();
|
||||||
|
|
||||||
|
$table->primary([AclRegistrar::$pivotPermission, AclRegistrar::$pivotGroup], 'group_has_permission_permission_id_group_id_primary');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$groupHasPermissionsTable = config('acl.tables.group_has_permissions', 'group_has_permissions');
|
||||||
|
|
||||||
|
Schema::dropIfExists($groupHasPermissionsTable);
|
||||||
|
}
|
||||||
|
}
|
18
resources/lang/vendor/acl/de/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/de/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'Dieser Benutzer verfügt nicht über die erforderlichen Gruppen, um auf diese Route zuzugreifen.',
|
||||||
|
'forPermissions' => 'Dieser Benutzer verfügt nicht über die erforderlichen Berechtigungen, um auf diese Route zuzugreifen',
|
||||||
|
'notLoggedIn' => 'Sie sind nicht angemeldet',
|
||||||
|
'forGroupsOrPermissions' => 'Sie haben keine Berechtigungen, um auf diese Route zuzugreifen',
|
||||||
|
'permission_already_exists' => 'Eine Genehmigung mit dieser Schnecke existiert bereits!',
|
||||||
|
'group_already_exists' => 'Eine Gruppe mit diesem Slug oder Namen existiert bereits!',
|
||||||
|
'permission_does_not_exist' => 'Es gibt keine Erlaubnis mit dieser ID:',
|
||||||
|
'permission_does_not_exist_with_slug' => 'Es gibt keine Erlaubnis für diesen Slug:',
|
||||||
|
'group_does_not_exist' => 'Es gibt keine Gruppe mit dieser ID:',
|
||||||
|
'group_does_not_exist_with_slug' => 'Es gibt keine Gruppe mit dieser Schnecke:',
|
||||||
|
'user_does_not_exist_with_name' => 'Es gibt keinen Benutzer mit diesem Namen:',
|
||||||
|
'user_does_not_exist' => 'Es gibt keinen Benutzer mit dieser ID:',
|
||||||
|
'null_model' => 'Sie verwenden ein Nullmodell als Parameter.',
|
||||||
|
'ignition_not_installed' => 'Die Zündung ist nicht installiert, bitte installieren, um Lösungen zu verwenden. composer require --dev facade/ignition',
|
||||||
|
];
|
18
resources/lang/vendor/acl/en/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/en/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'This user does not have the necessary groups to access this route.',
|
||||||
|
'forPermissions' => 'This user does not have the necessary permissions to access this route',
|
||||||
|
'notLoggedIn' => 'You are not logged in.',
|
||||||
|
'forGroupsOrPermissions' => 'You do not have any of the permissions required to access this route',
|
||||||
|
'permission_already_exists' => 'One permission with this slug already exists!',
|
||||||
|
'group_already_exists' => 'One group with this slug or name already exists!',
|
||||||
|
'permission_does_not_exist' => 'There is no permission with this id:',
|
||||||
|
'permission_does_not_exist_with_slug' => 'There is no permission with this slug:',
|
||||||
|
'group_does_not_exist' => 'There is no group with this Id:',
|
||||||
|
'group_does_not_exist_with_slug' => 'There is no group with this slug:',
|
||||||
|
'user_does_not_exist_with_name' => 'There is no user with this name:',
|
||||||
|
'user_does_not_exist' => 'There is no user with this id:',
|
||||||
|
'null_model' => 'You are passing a null model as parameter',
|
||||||
|
'ignition_not_installed' => 'Ignition is not installed, please install to use solutions. composer require --dev facade/ignition',
|
||||||
|
];
|
18
resources/lang/vendor/acl/es/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/es/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'No perteneces a ningún grupo con los permisos necesarios para acceder a esta ruta.',
|
||||||
|
'forPermissions' => 'No tienes los permisos necesarios para acceder a esta ruta',
|
||||||
|
'notLoggedIn' => 'No has iniciado sesión.',
|
||||||
|
'forGroupsOrPermissions' => 'No tiene ninguno de los permisos necesarios para acceder a esta ruta',
|
||||||
|
'permission_already_exists' => '¡Ya existe un permiso con esta slug o nombre!',
|
||||||
|
'group_already_exists' => '¡Ya existe un grupo con esta slug o nombre!',
|
||||||
|
'permission_does_not_exist' => 'No hay permiso con esta Id:',
|
||||||
|
'permission_does_not_exist_with_slug' => 'No hay permiso con este slug:',
|
||||||
|
'group_does_not_exist' => 'No hay grupo con esta Id:',
|
||||||
|
'group_does_not_exist_with_slug' => 'No hay grupo con este slug:',
|
||||||
|
'user_does_not_exist_with_name' => 'No hay usuario con este nombre:',
|
||||||
|
'user_does_not_exist' => 'No hay usuario con esta Id:',
|
||||||
|
'null_model' => 'Está pasando un modelo nulo como parámetro',
|
||||||
|
'ignition_not_installed' => 'Ignition no está instalado, por favor instalar para utilizar solutions. composer require --dev facade/ignition',
|
||||||
|
];
|
18
resources/lang/vendor/acl/fr/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/fr/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'Cet utilisateur ne dispose pas des groupes nécessaires pour accéder à cet itinéraire.',
|
||||||
|
'forPermissions' => 'Cet utilisateur ne dispose pas des autorisations nécessaires pour accéder à cette route.',
|
||||||
|
'notLoggedIn' => "Vous n'êtes pas connecté",
|
||||||
|
'forGroupsOrPermissions' => "Vous ne disposez d'aucune des autorisations requises pour accéder à cette route",
|
||||||
|
'permission_already_exists' => 'Un permis avec cette limace existe déjà!',
|
||||||
|
'group_already_exists' => 'Un groupe avec cette limace ou ce nom existe déjà!',
|
||||||
|
'permission_does_not_exist' => "Il n'y a pas de permission avec cet identifiant:",
|
||||||
|
'permission_does_not_exist_with_slug' => "Il n'y a pas d'autorisation avec cette limace:",
|
||||||
|
'group_does_not_exist' => "Il n'y a pas de groupe avec cet identifiant:",
|
||||||
|
'group_does_not_exist_with_slug' => "Il n'y a pas de groupe avec cette limace:",
|
||||||
|
'user_does_not_exist_with_name' => "Il n'y a pas d'utilisateur avec ce nom:",
|
||||||
|
'user_does_not_exist' => "Il n'y a pas d'utilisateur avec cet identifiant:",
|
||||||
|
'null_model' => 'Vous utilisez un modèle null en tant que paramètre.',
|
||||||
|
'ignition_not_installed' => "L'allumage n'est pas installé, veuillez l'installer pour utiliser les solutions. composer require --dev facade/ignition",
|
||||||
|
];
|
18
resources/lang/vendor/acl/it/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/it/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'Questo utente non ha i gruppi necessari per accedere a questa rotta.',
|
||||||
|
'forPermissions' => 'Questo utente non ha le autorizzazioni necessarie per accedere a questa rotta',
|
||||||
|
'notLoggedIn' => 'Non sei loggato.',
|
||||||
|
'forGroupsOrPermissions' => 'Non hai nessuna delle autorizzazioni richieste per accedere a questa rotta',
|
||||||
|
'permission_already_exists' => 'Esiste già un permesso con questo proiettile!',
|
||||||
|
'group_already_exists' => 'Esiste già un gruppo con questo slug o nome!',
|
||||||
|
'permission_does_not_exist' => 'Non ci sono permessi con questo ID:',
|
||||||
|
'permission_does_not_exist_with_slug' => "Non c'è autorizzazione con questo slug:",
|
||||||
|
'group_does_not_exist' => "Non c'è gruppo con questo ID:",
|
||||||
|
'group_does_not_exist_with_slug' => "Non c'è gruppo con questo slug:",
|
||||||
|
'user_does_not_exist_with_name' => "Non c'è nessun utente con questo nome:",
|
||||||
|
'user_does_not_exist' => 'Non ci sono utenti con questo ID:',
|
||||||
|
'null_model' => 'Si sta utilizzando un modello null come parametro.',
|
||||||
|
'ignition_not_installed' => "L'accensione non è installata, installare per utilizzare le soluzioni. composer require --dev facade/ignition",
|
||||||
|
];
|
18
resources/lang/vendor/acl/pt-br/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/pt-br/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'Este usuário não possui os grupos necessários para acessar esta rota.',
|
||||||
|
'forPermissions' => 'Este usuário não possui as permissões necessárias para acessar esta rota',
|
||||||
|
'notLoggedIn' => 'Você não está logado no sistema.',
|
||||||
|
'forGroupsOrPermissions' => 'Você não possui nenhuma das permissões necessárias para acessar esta rota',
|
||||||
|
'permission_already_exists' => 'Uma permissão com este slug já existe!',
|
||||||
|
'group_already_exists' => 'Um grupo com este slug ou nome já existe!',
|
||||||
|
'permission_does_not_exist' => 'Não existe nenhuma permissão com esse id:',
|
||||||
|
'permission_does_not_exist_with_slug' => 'Não existe nenhuma permissão com esse slug:',
|
||||||
|
'group_does_not_exist' => 'Não existe nenhum grupo com esse Id:',
|
||||||
|
'group_does_not_exist_with_slug' => 'Não existe nenhum groupo com esse slug:',
|
||||||
|
'user_does_not_exist_with_name' => 'Não existe nenhum usuário com este nome:',
|
||||||
|
'user_does_not_exist' => 'Não existe nenhum usuário com este id:',
|
||||||
|
'null_model' => 'Você está usando um model nulo como parâmetro.',
|
||||||
|
'ignition_not_installed' => 'A ignição não está instalada, instale para usar soluções. composer require --dev facade/ignition',
|
||||||
|
];
|
18
resources/lang/vendor/acl/ru/acl.php
vendored
Normal file
18
resources/lang/vendor/acl/ru/acl.php
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'forGroups' => 'У этого пользователя нет необходимых групп для доступа к этому маршруту.',
|
||||||
|
'forPermissions' => 'У этого пользователя нет необходимых прав доступа к этому маршруту.',
|
||||||
|
'notLoggedIn' => 'Вы не авторизованы.',
|
||||||
|
'forGroupsOrPermissions' => 'У вас нет каких-либо разрешений, необходимых для доступа к этому маршруту',
|
||||||
|
'permission_already_exists' => 'Разрешение с этим слагом уже существует!',
|
||||||
|
'group_already_exists' => 'Группа с этим слагом или именем уже существует!',
|
||||||
|
'permission_does_not_exist' => 'Нет разрешения с этим идентификатором:',
|
||||||
|
'permission_does_not_exist_with_slug' => 'Нет разрешения с этим слагом:',
|
||||||
|
'group_does_not_exist' => 'Нет группы с таким идентификатором:',
|
||||||
|
'group_does_not_exist_with_slug' => 'Нет группы с этим слизнем:',
|
||||||
|
'user_does_not_exist_with_name' => 'Нет пользователя с таким именем:',
|
||||||
|
'user_does_not_exist' => 'Нет пользователя с таким идентификатором:',
|
||||||
|
'null_model' => 'Вы используете нулевую модель в качестве параметра.',
|
||||||
|
'ignition_not_installed' => 'Зажигание не установлено, пожалуйста, установите, чтобы использовать решения. composer require --dev facade/ignition',
|
||||||
|
];
|
73
resources/views/vendor/junges/acl/_forms/groups/group.blade.php
vendored
Normal file
73
resources/views/vendor/junges/acl/_forms/groups/group.blade.php
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<input type="hidden" value="{{ csrf_token() }}" name="_token" id="_token">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="group-name">Nome:</label>
|
||||||
|
<input type="text"
|
||||||
|
id="group-name"
|
||||||
|
minlength="3"
|
||||||
|
name="name"
|
||||||
|
placeholder="Informe o nome do novo grupo"
|
||||||
|
value="{{ isset($group) ? $group->name : old('name') }}"
|
||||||
|
class="form-control">
|
||||||
|
@if($errors->has('name'))
|
||||||
|
<span class="text-danger">{{ $errors->first('name') }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="group-slug">Slug do grupo:</label>
|
||||||
|
<input type="text"
|
||||||
|
id="group-slug"
|
||||||
|
minlength="3"
|
||||||
|
name="slug"
|
||||||
|
placeholder="Informe o nome do novo grupo"
|
||||||
|
value="{{ isset($group) ? $group->slug : old('slug') }}"
|
||||||
|
class="form-control">
|
||||||
|
@if($errors->has('slug'))
|
||||||
|
<span class="text-danger">{{ $errors->first('slug') }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<label for="group-description">Descrição:</label>
|
||||||
|
<div class="form-group">
|
||||||
|
<textarea name="description"
|
||||||
|
id="group-description"
|
||||||
|
placeholder="Informe a descrição deste grupo"
|
||||||
|
minlength="5"
|
||||||
|
class="form-control"
|
||||||
|
cols="30" rows="10">{{ isset($group) ? $group->description : old('description') }}</textarea>
|
||||||
|
@if($errors->has('description'))
|
||||||
|
<span class="text-danger">{{ $errors->first('description') }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="group-permissions">Permissões:</label>
|
||||||
|
<select name="permissions[]"
|
||||||
|
style="width: 100%"
|
||||||
|
multiple
|
||||||
|
id="group-permissions"
|
||||||
|
class="form-control">
|
||||||
|
@if(isset($group))
|
||||||
|
@foreach($permissions as $permission)
|
||||||
|
<option value="{{ $permission->id }}"
|
||||||
|
{{ ($group->hasPermission($permission->id) ? 'selected' : '') }}
|
||||||
|
@if(old('$permissions') != null)
|
||||||
|
{{ (in_array($permission->id, old('permissions')) ? 'selected' : '') }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $permission->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($permissions as $permission)
|
||||||
|
<option value="{{ $permission->id }}"
|
||||||
|
@if(old('permissions') != null)
|
||||||
|
{{ in_array($permission->id, old('permissions')) ? 'selected' : '' }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $permission->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
@if($errors->has('permissions'))
|
||||||
|
<span class="text-danger">{{ $errors->first('permissions') }}</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
56
resources/views/vendor/junges/acl/_forms/users/add-group.blade.php
vendored
Normal file
56
resources/views/vendor/junges/acl/_forms/users/add-group.blade.php
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<div class="form-group">
|
||||||
|
<label for="users">Selecione o usuário</label>
|
||||||
|
<select name="user"
|
||||||
|
id="users"
|
||||||
|
class="form-control">
|
||||||
|
@if(isset($user))
|
||||||
|
@foreach($users as $u)
|
||||||
|
<option value="{{ $u->id }}"
|
||||||
|
@if(($u->id == $user->id) || ($u->id == old('user')))
|
||||||
|
selected
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $u->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($users as $u)
|
||||||
|
<option value="{{ $u->id }}" {{ $u->id == old('user') ? 'selected' : '' }}>
|
||||||
|
{{ $u->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
@if($errors->has('users'))
|
||||||
|
<small class="text-danger">{{ $errors->first('users') }}</small>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="groups">Selecione os grupos:</label>
|
||||||
|
<select name="groups[]"
|
||||||
|
multiple="multiple"
|
||||||
|
id="groups" class="form-control">
|
||||||
|
@if(isset($user))
|
||||||
|
@foreach($groups as $g)
|
||||||
|
<option value="{{ $g->id }}"
|
||||||
|
{{ $user->hasGroup($g) ? 'selected' : '' }}
|
||||||
|
@if(old('groups') != null)
|
||||||
|
{{ (in_array($g->id, old('groups')) ? 'selected' : '') }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $g->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($groups as $g)
|
||||||
|
<option value="{{ $g->id }}"
|
||||||
|
@if(old('groups') != null)
|
||||||
|
{{ in_array($g->id, old('groups')) ? 'selected' : '' }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $g->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
</div>
|
59
resources/views/vendor/junges/acl/_forms/users/add-permission.blade.php
vendored
Normal file
59
resources/views/vendor/junges/acl/_forms/users/add-permission.blade.php
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
@csrf
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="user">Selecione o usuário:</label>
|
||||||
|
<select name="user"
|
||||||
|
id="user"
|
||||||
|
class="form-control">
|
||||||
|
@if(isset($user))
|
||||||
|
@foreach($users as $u)
|
||||||
|
<option value="{{ $user->id }}"
|
||||||
|
@if(($u->id == $user->id) || ($u->id == old('user')))
|
||||||
|
selected
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $u->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($users as $u)
|
||||||
|
<option value="{{ $u->id }}" {{ $u->id == old('user') ? 'selected' : '' }}>
|
||||||
|
{{ $u->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
@if($errors->has('user'))
|
||||||
|
<small class="text-danger">{{ $errors->first('user') }}</small>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="user-permissions">Permissões:</label>
|
||||||
|
<select name="permissions[]"
|
||||||
|
style="width: 100%"
|
||||||
|
multiple
|
||||||
|
id="user-permissions"
|
||||||
|
class="form-control">
|
||||||
|
@if(isset($user))
|
||||||
|
@foreach($permissions as $permission)
|
||||||
|
<option value="{{ $permission->id }}"
|
||||||
|
{{ ($user->hasDirectPermission($permission->slug) ? 'selected' : '') }}
|
||||||
|
@if(old('$permissions') != null)
|
||||||
|
{{ (in_array($permission->id, old('permissions')) ? 'selected' : '') }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $permission->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@foreach($permissions as $permission)
|
||||||
|
<option value="{{ $permission->id }}"
|
||||||
|
@if(old('permissions') != null)
|
||||||
|
{{ in_array($permission->id, old('permissions')) ? 'selected' : '' }}
|
||||||
|
@endif
|
||||||
|
>
|
||||||
|
{{ $permission->name }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
</select>
|
||||||
|
@if($errors->has('permissions'))
|
||||||
|
<span class="text-danger">{{ $errors->first('permissions') }}</span>
|
||||||
|
@endif
|
Loading…
Reference in New Issue
Block a user