[wip] create main tables relation
This commit is contained in:
parent
f98ca8d532
commit
5021507cf6
5
.env.testing
Normal file
5
.env.testing
Normal file
@ -0,0 +1,5 @@
|
||||
APP_NAME=MauCuti
|
||||
APP_KEY=base64:Sf4lkQVbx/5zVvdEfCV+NyOK1ck7AaDX17IgB5/GZbg=
|
||||
|
||||
DB_CONNECTION=sqlite
|
||||
DB_DATABASE=database/testing.sqlite
|
76
app/Models/FormCuti.php
Normal file
76
app/Models/FormCuti.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class FormCuti extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'keterangan',
|
||||
'data',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'data' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'form_cuti';
|
||||
|
||||
public function staff(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'staff_id');
|
||||
}
|
||||
|
||||
public function creator(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'creator_id');
|
||||
}
|
||||
|
||||
// public function createRow(array $row): void
|
||||
// {
|
||||
// $row = Arr::only($row, ['tgl_mulai', 'tgl_selesai']);
|
||||
|
||||
// $row['form_cuti_id'] = $this->id;
|
||||
|
||||
// $row['supervisor'] = [
|
||||
// 'id' => null,
|
||||
// 'terima' => false,
|
||||
// 'keterangan' => null,
|
||||
// ];
|
||||
|
||||
// $row['personalia'] = [
|
||||
// 'id' => $this->creator->id,
|
||||
// 'terima' => false,
|
||||
// 'keterangan' => null,
|
||||
// ];
|
||||
|
||||
// // this runs setDataAttribute
|
||||
// if (isset($this->attributes['data'])) {
|
||||
// $this->data = array_merge($this->attributes['data'], [$row]);
|
||||
// } else {
|
||||
// $this->data = [$row];
|
||||
// }
|
||||
// }
|
||||
}
|
22
app/Models/Group.php
Normal file
22
app/Models/Group.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\AclGroupFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Group extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Create a new factory instance for the model.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
protected static function newFactory()
|
||||
{
|
||||
return AclGroupFactory::new();
|
||||
}
|
||||
}
|
46
app/Models/Pengajuan.php
Normal file
46
app/Models/Pengajuan.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Pengajuan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'form_cuti';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'tgl_mulai', 'tgl_selesai',
|
||||
];
|
||||
|
||||
public function personalia(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'terima_personalia');
|
||||
}
|
||||
|
||||
public function supervisor(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'terima_supervisor');
|
||||
}
|
||||
|
||||
public function disetujuiOleh(): Attribute
|
||||
{
|
||||
return new Attribute(
|
||||
get: fn ($value) => collect($this->personalia, $this->supervisor)
|
||||
);
|
||||
}
|
||||
}
|
@ -4,13 +4,15 @@
|
||||
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Junges\ACL\Concerns\HasGroups;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable;
|
||||
use HasApiTokens, HasFactory, HasGroups, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
@ -41,4 +43,13 @@ class User extends Authenticatable
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function formCuti(): HasOne
|
||||
{
|
||||
if ($this->hasGroup('personalia')) {
|
||||
return $this->hasOne(FormCuti::class, 'creator');
|
||||
} else {
|
||||
return $this->hasOne(FormCuti::class, 'staff');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,8 @@
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^8.75",
|
||||
"laravel/sanctum": "^2.11",
|
||||
"laravel/tinker": "^2.5"
|
||||
"laravel/tinker": "^2.5",
|
||||
"mateusjunges/laravel-acl": "^4.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.5",
|
||||
|
405
composer.lock
generated
405
composer.lock
generated
@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "c61ff82cbf0142a401a48a8161e1595a",
|
||||
"content-hash": "253db0ace68ab9463cac7bf84d93cf4f",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asm89/stack-cors",
|
||||
@ -493,6 +493,59 @@
|
||||
],
|
||||
"time": "2020-12-29T14:50:06+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",
|
||||
"version": "v2.2.0",
|
||||
@ -1660,6 +1713,89 @@
|
||||
],
|
||||
"time": "2022-04-17T13:12:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mateusjunges/laravel-acl",
|
||||
"version": "v4.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/mateusjunges/laravel-acl.git",
|
||||
"reference": "83e9c8cc11b004ff6402fa60046c4fb9282c10ce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/mateusjunges/laravel-acl/zipball/83e9c8cc11b004ff6402fa60046c4fb9282c10ce",
|
||||
"reference": "83e9c8cc11b004ff6402fa60046c4fb9282c10ce",
|
||||
"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://www.patreon.com/mateusjunges",
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-06T17:36:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "2.8.0",
|
||||
@ -2463,30 +2599,30 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.4",
|
||||
"version": "2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/log.git",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
|
||||
"reference": "ef29f6d262798707a9edd554e2b82517ef3a9376"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
|
||||
"url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376",
|
||||
"reference": "ef29f6d262798707a9edd554e2b82517ef3a9376",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
"php": ">=8.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.1.x-dev"
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Log\\": "Psr/Log/"
|
||||
"Psr\\Log\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@ -2507,9 +2643,9 @@
|
||||
"psr-3"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/log/tree/1.1.4"
|
||||
"source": "https://github.com/php-fig/log/tree/2.0.0"
|
||||
},
|
||||
"time": "2021-05-03T11:20:27+00:00"
|
||||
"time": "2021-07-14T16:41:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
@ -2763,25 +2899,24 @@
|
||||
},
|
||||
{
|
||||
"name": "ramsey/uuid",
|
||||
"version": "4.2.3",
|
||||
"version": "4.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ramsey/uuid.git",
|
||||
"reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df"
|
||||
"reference": "8505afd4fea63b81a85d3b7b53ac3cb8dc347c28"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df",
|
||||
"reference": "fc9bb7fb5388691fd7373cd44dcb4d63bbcf24df",
|
||||
"url": "https://api.github.com/repos/ramsey/uuid/zipball/8505afd4fea63b81a85d3b7b53ac3cb8dc347c28",
|
||||
"reference": "8505afd4fea63b81a85d3b7b53ac3cb8dc347c28",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"brick/math": "^0.8 || ^0.9",
|
||||
"ext-ctype": "*",
|
||||
"ext-json": "*",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"ramsey/collection": "^1.0",
|
||||
"symfony/polyfill-ctype": "^1.8",
|
||||
"symfony/polyfill-php80": "^1.14"
|
||||
"php": "^8.0",
|
||||
"ramsey/collection": "^1.0"
|
||||
},
|
||||
"replace": {
|
||||
"rhumsaa/uuid": "self.version"
|
||||
@ -2818,9 +2953,6 @@
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "4.x-dev"
|
||||
},
|
||||
"captainhook": {
|
||||
"force-install": true
|
||||
}
|
||||
@ -2845,7 +2977,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/ramsey/uuid/issues",
|
||||
"source": "https://github.com/ramsey/uuid/tree/4.2.3"
|
||||
"source": "https://github.com/ramsey/uuid/tree/4.3.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -2857,7 +2989,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-09-25T23:10:38+00:00"
|
||||
"time": "2022-03-27T21:42:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "swiftmailer/swiftmailer",
|
||||
@ -3036,21 +3168,20 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v5.4.3",
|
||||
"version": "v6.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
"reference": "b0a190285cd95cb019237851205b8140ef6e368e"
|
||||
"reference": "05c40f02f621609404b8820ff8bc39acb46e19cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e",
|
||||
"reference": "b0a190285cd95cb019237851205b8140ef6e368e",
|
||||
"url": "https://api.github.com/repos/symfony/css-selector/zipball/05c40f02f621609404b8820ff8bc39acb46e19cf",
|
||||
"reference": "05c40f02f621609404b8820ff8bc39acb46e19cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -3082,7 +3213,7 @@
|
||||
"description": "Converts CSS selectors to XPath expressions",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/css-selector/tree/v5.4.3"
|
||||
"source": "https://github.com/symfony/css-selector/tree/v6.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3098,29 +3229,29 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-01-02T09:53:40+00:00"
|
||||
"time": "2022-02-25T11:15:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v2.5.2",
|
||||
"version": "v3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
|
||||
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
|
||||
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.5-dev"
|
||||
"dev-main": "3.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@ -3149,7 +3280,7 @@
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3165,7 +3296,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-01-02T09:53:40+00:00"
|
||||
"time": "2022-02-25T11:15:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/error-handler",
|
||||
@ -3240,40 +3371,38 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v5.4.9",
|
||||
"version": "v6.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc"
|
||||
"reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc",
|
||||
"reference": "8e6ce1cc0279e3ff3c8ff0f43813bc88d21ca1bc",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347",
|
||||
"reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/event-dispatcher-contracts": "^2|^3",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
"php": ">=8.1",
|
||||
"symfony/event-dispatcher-contracts": "^2|^3"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/dependency-injection": "<4.4"
|
||||
"symfony/dependency-injection": "<5.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/event-dispatcher-implementation": "1.0",
|
||||
"symfony/event-dispatcher-implementation": "2.0"
|
||||
"symfony/event-dispatcher-implementation": "2.0|3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/error-handler": "^4.4|^5.0|^6.0",
|
||||
"symfony/expression-language": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-foundation": "^4.4|^5.0|^6.0",
|
||||
"symfony/config": "^5.4|^6.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0",
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/expression-language": "^5.4|^6.0",
|
||||
"symfony/http-foundation": "^5.4|^6.0",
|
||||
"symfony/service-contracts": "^1.1|^2|^3",
|
||||
"symfony/stopwatch": "^4.4|^5.0|^6.0"
|
||||
"symfony/stopwatch": "^5.4|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
@ -3305,7 +3434,7 @@
|
||||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v5.4.9"
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3321,24 +3450,24 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-05T16:45:39+00:00"
|
||||
"time": "2022-05-05T16:51:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher-contracts",
|
||||
"version": "v2.5.2",
|
||||
"version": "v3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
||||
"reference": "f98b54df6ad059855739db6fcbc2d36995283fe1"
|
||||
"reference": "02ff5eea2f453731cfbc6bc215e456b781480448"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1",
|
||||
"reference": "f98b54df6ad059855739db6fcbc2d36995283fe1",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448",
|
||||
"reference": "02ff5eea2f453731cfbc6bc215e456b781480448",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"php": ">=8.1",
|
||||
"psr/event-dispatcher": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
@ -3347,7 +3476,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.5-dev"
|
||||
"dev-main": "3.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@ -3384,7 +3513,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2"
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -3400,7 +3529,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-01-02T09:53:40+00:00"
|
||||
"time": "2022-02-25T11:15:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
@ -4787,34 +4916,33 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v5.4.10",
|
||||
"version": "v6.1.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "4432bc7df82a554b3e413a8570ce2fea90e94097"
|
||||
"reference": "1903f2879875280c5af944625e8246d81c2f0604"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/4432bc7df82a554b3e413a8570ce2fea90e94097",
|
||||
"reference": "4432bc7df82a554b3e413a8570ce2fea90e94097",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604",
|
||||
"reference": "1903f2879875280c5af944625e8246d81c2f0604",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"php": ">=8.1",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-intl-grapheme": "~1.0",
|
||||
"symfony/polyfill-intl-normalizer": "~1.0",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php80": "~1.15"
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/translation-contracts": ">=3.0"
|
||||
"symfony/translation-contracts": "<2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/error-handler": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-client": "^4.4|^5.0|^6.0",
|
||||
"symfony/translation-contracts": "^1.1|^2",
|
||||
"symfony/var-exporter": "^4.4|^5.0|^6.0"
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/http-client": "^5.4|^6.0",
|
||||
"symfony/translation-contracts": "^2.0|^3.0",
|
||||
"symfony/var-exporter": "^5.4|^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@ -4853,7 +4981,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v5.4.10"
|
||||
"source": "https://github.com/symfony/string/tree/v6.1.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -4869,52 +4997,51 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-26T15:57:47+00:00"
|
||||
"time": "2022-06-26T16:35:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v5.4.9",
|
||||
"version": "v6.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "1639abc1177d26bcd4320e535e664cef067ab0ca"
|
||||
"reference": "b254416631615bc6fe49b0a67f18658827288147"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/1639abc1177d26bcd4320e535e664cef067ab0ca",
|
||||
"reference": "1639abc1177d26bcd4320e535e664cef067ab0ca",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/b254416631615bc6fe49b0a67f18658827288147",
|
||||
"reference": "b254416631615bc6fe49b0a67f18658827288147",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"php": ">=8.1",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php80": "^1.16",
|
||||
"symfony/translation-contracts": "^2.3"
|
||||
"symfony/translation-contracts": "^2.3|^3.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<4.4",
|
||||
"symfony/console": "<5.3",
|
||||
"symfony/dependency-injection": "<5.0",
|
||||
"symfony/http-kernel": "<5.0",
|
||||
"symfony/twig-bundle": "<5.0",
|
||||
"symfony/yaml": "<4.4"
|
||||
"symfony/config": "<5.4",
|
||||
"symfony/console": "<5.4",
|
||||
"symfony/dependency-injection": "<5.4",
|
||||
"symfony/http-kernel": "<5.4",
|
||||
"symfony/twig-bundle": "<5.4",
|
||||
"symfony/yaml": "<5.4"
|
||||
},
|
||||
"provide": {
|
||||
"symfony/translation-implementation": "2.3"
|
||||
"symfony/translation-implementation": "2.3|3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/config": "^5.4|^6.0",
|
||||
"symfony/console": "^5.4|^6.0",
|
||||
"symfony/dependency-injection": "^5.0|^6.0",
|
||||
"symfony/finder": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0",
|
||||
"symfony/finder": "^5.4|^6.0",
|
||||
"symfony/http-client-contracts": "^1.1|^2.0|^3.0",
|
||||
"symfony/http-kernel": "^5.0|^6.0",
|
||||
"symfony/intl": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-kernel": "^5.4|^6.0",
|
||||
"symfony/intl": "^5.4|^6.0",
|
||||
"symfony/polyfill-intl-icu": "^1.21",
|
||||
"symfony/routing": "^5.4|^6.0",
|
||||
"symfony/service-contracts": "^1.1.2|^2|^3",
|
||||
"symfony/yaml": "^4.4|^5.0|^6.0"
|
||||
"symfony/yaml": "^5.4|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log-implementation": "To use logging capability in translator",
|
||||
@ -4950,7 +5077,7 @@
|
||||
"description": "Provides tools to internationalize your application",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/translation/tree/v5.4.9"
|
||||
"source": "https://github.com/symfony/translation/tree/v6.1.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -4966,24 +5093,24 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-06T12:33:37+00:00"
|
||||
"time": "2022-05-11T12:12:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation-contracts",
|
||||
"version": "v2.5.2",
|
||||
"version": "v3.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation-contracts.git",
|
||||
"reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe"
|
||||
"reference": "606be0f48e05116baef052f7f3abdb345c8e02cc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe",
|
||||
"reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe",
|
||||
"url": "https://api.github.com/repos/symfony/translation-contracts/zipball/606be0f48e05116baef052f7f3abdb345c8e02cc",
|
||||
"reference": "606be0f48e05116baef052f7f3abdb345c8e02cc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5"
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/translation-implementation": ""
|
||||
@ -4991,7 +5118,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.5-dev"
|
||||
"dev-main": "3.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@ -5001,7 +5128,10 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Contracts\\Translation\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Test/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@ -5028,7 +5158,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/translation-contracts/tree/v2.5.2"
|
||||
"source": "https://github.com/symfony/translation-contracts/tree/v3.1.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -5044,7 +5174,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-06-27T16:58:25+00:00"
|
||||
"time": "2022-06-27T17:24:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
@ -5615,59 +5745,6 @@
|
||||
},
|
||||
"time": "2022-06-30T18:26: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",
|
||||
"version": "v1.20.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'
|
||||
]
|
||||
];
|
@ -67,7 +67,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
'timezone' => 'Asia/Jakarta',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@ -80,7 +80,7 @@
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'en',
|
||||
'locale' => 'id',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
58
database/factories/AclGroupFactory.php
Normal file
58
database/factories/AclGroupFactory.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Group;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class AclGroupFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
protected $model = Group::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->unique()->randomElement([
|
||||
'personalia', 'supervisor', 'staff',
|
||||
]),
|
||||
'guard_name' => 'web',
|
||||
];
|
||||
}
|
||||
|
||||
public function personalia(): static
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'name' => 'personalia',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function supervisor(): static
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'name' => 'supervisor',
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function staff(): static
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'name' => 'staff',
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
20
database/factories/FormCutiFactory.php
Normal file
20
database/factories/FormCutiFactory.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
class FormCutiFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Group;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@ -36,4 +37,19 @@ public function unverified()
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function personalia()
|
||||
{
|
||||
return $this->has(Group::factory()->personalia()->count(1));
|
||||
}
|
||||
|
||||
public function supervisor()
|
||||
{
|
||||
return $this->has(Group::factory()->supervisor()->count(1));
|
||||
}
|
||||
|
||||
public function staff()
|
||||
{
|
||||
return $this->has(Group::factory()->staff()->count(1));
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ public function up()
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFormCutiTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('form_cuti', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->text('keterangan')->nullable();
|
||||
$table->json('data')->nullable();
|
||||
$table->foreignIdFor(User::class, 'staff_id');
|
||||
$table->foreignIdFor(User::class, 'creator_id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('form_cuti');
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use App\Models\FormCuti;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePengajuanTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('pengajuan', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignIdFor(FormCuti::class);
|
||||
$table->date('tgl_mulai');
|
||||
$table->date('tgl_selesai');
|
||||
$table->foreignIdFor(User::class, 'terima_personalia')->nullable();
|
||||
$table->foreignIdFor(User::class, 'terima_supervisor')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('pengajuans');
|
||||
}
|
||||
}
|
60
database/seeders/AclTableSeeder.php
Normal file
60
database/seeders/AclTableSeeder.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Junges\ACL\Models\Group;
|
||||
use Junges\ACL\Models\Permission;
|
||||
|
||||
class AclTableSeeder extends Seeder
|
||||
{
|
||||
protected array $groups = [];
|
||||
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$this->groupSeeder();
|
||||
$this->permissionSeeder();
|
||||
$this->assignPermissionsToGroups();
|
||||
}
|
||||
|
||||
protected function groupSeeder(): void
|
||||
{
|
||||
$this->groups['personalia'] = Group::create(['name' => 'personalia']);
|
||||
$this->groups['supervisor'] = Group::create(['name' => 'supervisor']);
|
||||
$this->groups['staff'] = Group::create(['name' => 'staff']);
|
||||
}
|
||||
|
||||
protected function permissionSeeder(): void
|
||||
{
|
||||
Permission::create(['name' => 'view-user']);
|
||||
Permission::create(['name' => 'view-user.group']);
|
||||
Permission::create(['name' => 'view-form']);
|
||||
Permission::create(['name' => 'view-form.group']);
|
||||
Permission::create(['name' => 'create-form']);
|
||||
Permission::create(['name' => 'update-form']);
|
||||
Permission::create(['name' => 'delete-form']);
|
||||
Permission::create(['name' => 'create-row']);
|
||||
Permission::create(['name' => 'update-row']);
|
||||
// Permission::create(['name' => 'delete-row']);
|
||||
}
|
||||
|
||||
protected function assignPermissionsToGroups(): void
|
||||
{
|
||||
$this->groups['personalia']->assignPermission([
|
||||
'view-user', 'view-form', 'create-form', 'update-form', 'delete-form', 'update-row',
|
||||
]);
|
||||
|
||||
$this->groups['supervisor']->assignPermission([
|
||||
'view-user.group', 'view-form.group', 'update-row',
|
||||
]);
|
||||
|
||||
$this->groups['staff']->assignPermission([
|
||||
'create-row',
|
||||
]);
|
||||
}
|
||||
}
|
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
|
62
tests/Feature/App/TesMembuatPengajuanCuti.php
Normal file
62
tests/Feature/App/TesMembuatPengajuanCuti.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\App;
|
||||
|
||||
use App\Models\FormCuti;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class TesMembuatPengajuanCuti extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected FormCuti $formCuti;
|
||||
|
||||
protected User $personalia;
|
||||
protected User $supervisor;
|
||||
protected User $staff;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->personalia = User::factory()->personalia()->create();
|
||||
$this->supervisor = User::factory()->supervisor()->create();
|
||||
$this->staff = User::factory()->staff()->create();
|
||||
|
||||
$this->formCuti = FormCuti::factory()->for($this->staff, 'staff')->for($this->personalia, 'creator')->create();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function dapat_membuat_pengajuan_cuti()
|
||||
{
|
||||
$row = [
|
||||
'tgl_mulai' => today(),
|
||||
'tgl_selesai' => today()->addDays(4),
|
||||
];
|
||||
|
||||
$this->formCuti->createRow($row);
|
||||
|
||||
$this->formCuti->save();
|
||||
|
||||
$this->assertSame(
|
||||
[
|
||||
'tgl_mulai' => $row['tgl_mulai']->toISOString(),
|
||||
'tgl_selesai' => $row['tgl_selesai']->toISOString(),
|
||||
'form_cuti_id' => $this->formCuti->id,
|
||||
'supervisor' => [
|
||||
'id' => null,
|
||||
'terima' => false,
|
||||
'keterangan' => null,
|
||||
],
|
||||
'personalia' => [
|
||||
'id' => $this->personalia->id,
|
||||
'terima' => false,
|
||||
'keterangan' => null,
|
||||
],
|
||||
],
|
||||
$this->formCuti->data[0]
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user