Compare commits

...

29 Commits
master ... temp

Author SHA1 Message Date
20f47798fe Add Logo AGI 2023-06-02 16:34:51 +07:00
bb0e4a9839 temporary upodate 2023-06-02 16:30:27 +07:00
4aa1474bdc add module filemanager 2023-05-26 11:30:48 +07:00
03244e3486 update menu 2023-05-26 09:53:30 +07:00
cbec454402 Update Locale 2023-05-26 09:33:02 +07:00
05b26a4b95 Update Helper & Sample .env 2023-05-25 17:38:40 +07:00
4d2959b538 Add Logo AGI 2023-05-25 11:00:04 +07:00
0ab8abda5f Add Setting Migration dan module qrcode 2023-05-25 10:49:46 +07:00
19001d8530 update comooser 2023-05-23 18:19:14 +07:00
80a4a27df2 Merge remote-tracking branch 'origin/submodule' into submodule 2023-05-22 21:45:43 +07:00
78253e7b21 Update Menu 2023-05-22 21:43:57 +07:00
5b65bae426 Delete 'composer.lock' 2023-05-20 14:31:44 +00:00
71068046de update gitignore 2023-05-20 21:30:36 +07:00
8c71f3cbe1 remove putrakuningan module 2023-05-20 21:27:28 +07:00
a90f775f2a remove unused function 2023-05-20 21:08:17 +07:00
26e32d4d54 Delete unused file and folder 2023-05-16 16:56:59 +07:00
e736b5b6cc update core : move logs to modules 2023-05-16 10:18:32 +07:00
e7403cb94f add blank page 2023-05-15 21:03:24 +07:00
f27e69d51f update gitignore 2023-05-15 21:01:34 +07:00
26f2b816a3 Update '.gitmodules' 2023-05-15 11:31:17 +00:00
67ef3c368e delete modules 2023-05-15 18:17:44 +07:00
bd3233494e submoduke 2023-05-15 18:15:36 +07:00
6033e1850a Merge branch 'modular' of https://git.putrakuningan.com/putrakuningan/cetak-label into modular
# Conflicts:
#	Modules/CetakLabel/Routes/api.php
2023-05-15 10:16:35 +07:00
6f91525f6e update module cetak label 2023-05-15 10:13:09 +07:00
9bfae06272 update route 2023-05-12 09:40:41 +07:00
cb0793fde0 Add module Cetak label 2023-05-11 08:29:47 +07:00
4e95c29411 add modular 2023-05-10 22:15:50 +07:00
38ba8fac54 Merge remote-tracking branch 'origin/master' into new
# Conflicts:
#	composer.lock
2023-05-08 13:24:53 +07:00
eea0e3d304 update doc block 2023-05-05 07:54:31 +07:00
238 changed files with 2922 additions and 21519 deletions

View File

@ -4,6 +4,11 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost:8000
METHOD_AUTH=usermanager
IP_USER_MANAGER=10.0.20.68
PORT_USER_MANAGER=82
APP_ID=WOF
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

2
.gitignore vendored
View File

@ -6,6 +6,7 @@
/public/mix-manifest.json
/storage/*.key
/vendor
/Modules/*
.env
.env.backup
.phpunit.result.cache
@ -16,3 +17,4 @@ npm-debug.log
yarn-error.log
/.idea
/.vscode
composer.lock

0
Modules/index.html Normal file
View File

View File

@ -1,89 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\Directorat;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class DirectoratDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%");
}
})
->addIndexColumn()
->addColumn('action', 'pages.masters.directorat._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(Directorat $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('directorat-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Directorat_' . date('YmdHis');
}
}

View File

@ -1,128 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\Document;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class DocumentDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%");
}
})
->addColumn('kode_directorat',function($model){
return $model->directorat->kode;
})
->addColumn('name_directorat',function($model){
return $model->directorat->name;
})
->addColumn('kode_sub_directorat',function($model){
return $model->sub_directorat->kode;
})
->addColumn('name_sub_directorat',function($model){
return $model->sub_directorat->name;
})
->addColumn('kode_pekerjaan',function($model){
return $model->job->kode;
})
->addColumn('name_pekerjaan',function($model){
return $model->job->name;
})
->addColumn('kode_sub_pekerjaan',function($model){
return $model->sub_job->kode;
})
->addColumn('name_sub_pekerjaan',function($model){
return $model->sub_job->name;
})
->addColumn('kode_sub_sub_pekerjaan',function($model){
return $model->sub_sub_job->kode;
})
->addColumn('name_sub_sub_pekerjaan',function($model){
return $model->sub_sub_job->name;
})
->addIndexColumn()
->addColumn('action', 'pages.app.document._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(Document $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('document-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('kode_directorat')->title('Kode Direktorat'),
Column::make('name_directorat')->title('Nama Direktorat'),
Column::make('kode_sub_directorat')->title('Kode Sub Direktorat'),
Column::make('name_sub_directorat')->title('Nama Sub Direktorat'),
Column::make('kode_pekerjaan')->title('Kode Pekerjaan'),
Column::make('name_pekerjaan')->title('Nama Pekerjaan'),
Column::make('kode_sub_pekerjaan')->title('Kode Sub Pekerjaan'),
Column::make('name_sub_pekerjaan')->title('Nama Sub Pekerjaan'),
Column::make('kode_sub_sub_pekerjaan')->title('Kode Sub Sub Pekerjaan'),
Column::make('name_sub_sub_pekerjaan')->title('Nama Sub Sub Pekerjaan'),
Column::make('status'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Document_' . date('YmdHis');
}
}

View File

@ -1,89 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\DocumentType;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class DocumentTypeDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%");
}
})
->addIndexColumn()
->addColumn('action', 'pages.app.document-type._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(DocumentType $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('document-type-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Document_Type_' . date('YmdHis');
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\Job;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class JobDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%")
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('subDirectorat', 'name', 'like', '%'.$search['value'].'%');
}
})
->addIndexColumn()
->addColumn('directorat', function ($job) {
return $job->directorat->name;
})
->addColumn('sub_directorat', function ($job) {
return $job->subDirectorat->name;
})
->addColumn('action', 'pages.masters.job._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(Job $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('job-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('directorat'),
Column::make('sub_directorat'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Job_' . date('YmdHis');
}
}

View File

@ -1,120 +0,0 @@
<?php
namespace App\DataTables\Logs;
use Spatie\Activitylog\Models\Activity;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class AuditLogsDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
*
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->rawColumns(['description', 'properties', 'action'])
->editColumn('id', function (Activity $model) {
return $model->id;
})
->editColumn('subject_id', function (Activity $model) {
if (!isset($model->subject)) {
return '';
}
if (isset($model->subject->name)) {
return $model->subject->name;
}
return $model->subject->user()->first()->name;
})
->editColumn('causer_id', function (Activity $model) {
return $model->causer ? $model->causer->name : __('System');
})
->editColumn('properties', function (Activity $model) {
$content = $model->properties;
return view('pages.log.audit._details', compact('content'));
})
->editColumn('created_at', function (Activity $model) {
return $model->created_at->format('d M, Y H:i:s');
})
->addColumn('action', function (Activity $model) {
return view('pages.log.audit._action-menu', compact('model'));
});
}
/**
* Get query source of dataTable.
*
* @param Activity $model
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(Activity $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('audit-log-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(true)
->orderBy(6)
->responsive()
->autoWidth(false)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::make('id')->title('Log ID'),
Column::make('log_name')->title(__('Location')),
Column::make('description'),
Column::make('subject_type'),
Column::make('subject_id')->title(__('Subject')),
Column::make('causer_id')->title(__('Causer')),
Column::make('created_at'),
Column::computed('action')
->exportable(false)
->printable(false)
->addClass('text-center')
->responsivePriority(-1),
Column::make('properties')->addClass('none'),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename() : string
{
return 'DataLogs_'.date('YmdHis');
}
}

View File

@ -1,143 +0,0 @@
<?php
namespace App\DataTables\Logs;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Jackiedo\LogReader\Exceptions\UnableToRetrieveLogFilesException;
use Jackiedo\LogReader\LogReader;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class SystemLogsDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
*
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->collection($query)
->rawColumns(['action', 'level'])
->editColumn('id', function (Collection $model) {
return Str::limit($model->get('id'), 5, '');
})
->editColumn('file_path', function (Collection $model) {
return Str::limit($model->get('file_path'));
})
->editColumn('message', function (Collection $model) {
return Str::limit($model->get('context')->message, 95);
})
->editColumn('date', function (Collection $model) {
return $model->get('date')->format('d M, Y H:i:s');
})
->editColumn('level', function (Collection $model) {
$styles = [
'emergency' => 'danger',
'alert' => 'warning',
'critical' => 'danger',
'error' => 'danger',
'warning' => 'warning',
'notice' => 'success',
'info' => 'info',
'debug' => 'primary',
];
$style = 'info';
if (isset($styles[$model->get('level')])) {
$style = $styles[$model->get('level')];
}
$value = $model->get('level');
return '<div class="badge badge-light-'.$style.' fw-bolder">'.$value.'</div>';
})
->editColumn('context', function (Collection $model) {
$content = $model->get('context');
return view('pages.log.system._details', compact('content'));
})
->addColumn('action', function (Collection $model) {
return view('pages.log.system._action-menu', compact('model'));
});
}
/**
* Get query source of dataTable.
*
* @param LogReader $model
*
* @return Collection
*/
public function query(LogReader $model)
{
$data = collect();
$model->setLogPath(storage_path('logs'));
try {
$data = $model->get()->merge($data);
} catch (UnableToRetrieveLogFilesException $exception) {
}
$data = $data->map(function ($a) {
return (collect($a))->only(['id', 'date', 'environment', 'level', 'file_path', 'context']);
});
return $data;
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('system-log-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(true)
->orderBy(3)
->responsive()
->autoWidth(false)
->parameters(['scrollX' => true])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::make('id')->title('Log ID')->width(50),
Column::make('message'),
Column::make('level'),
Column::make('date')->width(130),
Column::computed('action')
->exportable(false)
->printable(false)
->addClass('text-center')
->responsivePriority(-1),
Column::make('environment')->addClass('none'),
Column::make('file_path')->title(__('Log Path'))->addClass('none'),
Column::make('context')->addClass('none'),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename() : string
{
return 'SystemLogs_'.date('YmdHis');
}
}

View File

@ -1,89 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\SpecialCode;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class SpecialCodeDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%");
}
})
->addIndexColumn()
->addColumn('action', 'pages.masters.special-code._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(SpecialCode $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('special-code-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Special_Code_' . date('YmdHis');
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\SubDirectorat;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class SubDirectoratDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%")
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%');
}
})
->addIndexColumn()
->addColumn('directorat', function ($subDirectorat) {
return $subDirectorat->directorat->name;
})
->addColumn('action', 'pages.masters.sub-directorat._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(SubDirectorat $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('sub-directorat-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('directorat'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Sub_Directorat_' . date('YmdHis');
}
}

View File

@ -1,104 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\SubJob;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class SubJobDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%")
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('subDirectorat', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('job', 'name', 'like', '%'.$search['value'].'%');
}
})
->addIndexColumn()
->addColumn('directorat', function ($subJob) {
return $subJob->directorat->name;
})
->addColumn('sub_directorat', function ($subJob) {
return $subJob->subDirectorat->name;
})
->addColumn('job', function ($subJob) {
return $subJob->job->name;
})
->addColumn('action', 'pages.masters.sub-job._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(SubJob $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('sub-job-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('directorat'),
Column::make('sub_directorat'),
Column::make('job'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Sub_Job_' . date('YmdHis');
}
}

View File

@ -1,109 +0,0 @@
<?php
namespace App\DataTables;
use App\Models\SubSubJob;
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
use Yajra\DataTables\EloquentDataTable;
use Yajra\DataTables\Html\Builder as HtmlBuilder;
use Yajra\DataTables\Html\Button;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Html\Editor\Editor;
use Yajra\DataTables\Html\Editor\Fields;
use Yajra\DataTables\Services\DataTable;
class SubSubJobDataTable extends DataTable
{
/**
* Build the DataTable class.
*
* @param QueryBuilder $query Results from query() method.
*/
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('kode', 'like', "%" . $search['value'] . "%")
->orWhere('name', 'like', "%" . $search['value'] . "%")
->orWhereRelation('directorat', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('subDirectorat', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('job', 'name', 'like', '%'.$search['value'].'%')
->orWhereRelation('subJob', 'name', 'like', '%'.$search['value'].'%');
}
})
->addIndexColumn()
->addColumn('directorat', function ($subJob) {
return $subJob->directorat->name;
})
->addColumn('sub_directorat', function ($subJob) {
return $subJob->subDirectorat->name;
})
->addColumn('job', function ($subJob) {
return $subJob->job->name;
})
->addColumn('sub_job', function ($subJob) {
return $subJob->subJob->name;
})
->addColumn('action', 'pages.masters.sub-sub-job._action')
->setRowId('id');
}
/**
* Get the query source of dataTable.
*/
public function query(SubSubJob $model): QueryBuilder
{
return $model->newQuery();
}
/**
* Optional method if you want to use the html builder.
*/
public function html(): HtmlBuilder
{
return $this->builder()
->setTableId('sub-sub-job-table')
->columns($this->getColumns())
->minifiedAjax()
->stateSave(false)
->responsive()
->autoWidth(true)
->orderBy(1)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get the dataTable columns definition.
*/
public function getColumns(): array
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('directorat'),
Column::make('sub_directorat'),
Column::make('job'),
Column::make('sub_job'),
Column::make('kode'),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->width(60)
->addClass('text-center'),
];
}
/**
* Get the filename for export.
*/
protected function filename(): string
{
return 'Sub_Sub_Job_' . date('YmdHis');
}
}

View File

@ -1,102 +0,0 @@
<?php
namespace App\DataTables\Users;
use App\Models\PermissionGroup;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class PermissionsDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('name', 'like', "%" . $search['value'] . "%");
}
})
->rawColumns(['action','role'])
->addIndexColumn()
->addColumn('name', function (PermissionGroup $model) {
return $model->name;
})
->addColumn('role', function (PermissionGroup $model){
$role = $model->roles($model);
return view('pages.users.permissions._checkbox', compact('role'));
})
->addColumn('action', function (PermissionGroup $model) {
return view('pages.users.permissions._action', compact('model'));
});
}
/**
* Get query source of dataTable.
*
* @param \App\Models\PermissionGroup $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(PermissionGroup $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('user-permissions-table')
->columns($this->getColumns())
->minifiedAjax()
->orderBy(1,'asc')
->stateSave(false)
->responsive()
->autoWidth(false)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('name')->title('Name'),
Column::make('role')->title('Assign To'),
Column::computed('action')
->exportable(false)
->printable(false)
->addClass('text-center')
->responsivePriority(-1),
];
}
/**
* Get filename for export
* @return string
*/
protected function filename() : string
{
return 'Permissions_' . date('YmdHis');
}
}

View File

@ -1,96 +0,0 @@
<?php
namespace App\DataTables\Users;
use Spatie\Permission\Models\Role;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class RolesDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->rawColumns(['action'])
->addIndexColumn()
->filter(function ($query) {
if (request()->has('search')) {
$search = request()->get('search');
$query->where('name', 'like', "%" . $search['value'] . "%");
}
})
->addColumn('action', function (Role $model) {
return view('pages.users.roles._action', compact('model'));
});
}
/**
* Get query source of dataTable.
*
* @param \App\Models\Role $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(Role $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('user-roles-table')
->columns($this->getColumns())
->minifiedAjax()
->orderBy(1,'asc')
->stateSave(false)
->responsive()
->autoWidth(false)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('name'),
Column::computed('action')
->exportable(false)
->printable(false)
->addClass('text-center')
->responsivePriority(-1),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename() : string
{
return 'Roles_' . date('YmdHis');
}
}

View File

@ -1,97 +0,0 @@
<?php
namespace App\DataTables\Users;
use App\Models\User;
use Yajra\DataTables\Html\Column;
use Yajra\DataTables\Services\DataTable;
class UsersDataTable extends DataTable
{
/**
* Build DataTable class.
*
* @param mixed $query Results from query() method.
* @return \Yajra\DataTables\DataTableAbstract
*/
public function dataTable($query)
{
return datatables()
->eloquent($query)
->filter(function ($query) {
$search = request()->get('search');
if ($search['value']!=="") {
$query->where('name', 'like', "%" . $search['value'] . "%")
->orWhere('email', 'like', "%" . $search['value'] . "%");
}
})
->rawColumns(['action'])
->addIndexColumn()
->addColumn('action', function (User $model) {
return view('pages.users.users._action', compact('model'));
});
}
/**
* Get query source of dataTable.
*
* @param \App\Models\User $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function query(User $model)
{
return $model->newQuery();
}
/**
* Optional method if you want to use html builder.
*
* @return \Yajra\DataTables\Html\Builder
*/
public function html()
{
return $this->builder()
->setTableId('user-users-table')
->columns($this->getColumns())
->minifiedAjax()
->orderBy(1,'asc')
->stateSave(false)
->responsive()
->autoWidth(false)
->parameters([
'scrollX' => true,
'drawCallback' => 'function() { KTMenu.createInstances(); }',
])
->addTableClass('align-middle table-row-dashed fs-6 gy-5');
}
/**
* Get columns.
*
* @return array
*/
protected function getColumns()
{
return [
Column::make('DT_RowIndex')->title('No')->orderable(false)->searchable(false),
Column::make('name')->title(__('Name')),
Column::make('email'),
Column::computed('action')
->exportable(false)
->printable(false)
->addClass('text-center')
->responsivePriority(-1),
];
}
/**
* Get filename for export.
*
* @return string
*/
protected function filename() : string
{
return 'Users_' . date('YmdHis');
}
}

View File

@ -3,6 +3,7 @@
namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
class Handler extends ExceptionHandler
@ -46,5 +47,14 @@ class Handler extends ExceptionHandler
$this->reportable(function (Throwable $e) {
//
});
$this->renderable(function (NotFoundHttpException $e, $request) {
if ($request->is('api/*')) {
return response()->json([
'message' => 'Not found.'
], 404);
}
});
}
}

View File

@ -1,425 +1,545 @@
<?php
if (!function_exists('theme')) {
function theme()
{
return app(App\Core\Theme::class);
if (!function_exists('theme')) {
function theme()
{
return app(App\Core\Theme::class);
}
}
}
if (!function_exists('getName')) {
/**
* Get product name
*
* @return void
*/
function getName()
{
return config('settings.KT_THEME');
if (!function_exists('getName')) {
/**
* Get product name
*
* @return void
*/
function getName()
{
return config('settings.KT_THEME');
}
}
}
if (!function_exists('addHtmlAttribute')) {
/**
* Add HTML attributes by scope
*
* @param $scope
* @param $name
* @param $value
*
* @return void
*/
function addHtmlAttribute($scope, $name, $value)
{
theme()->addHtmlAttribute($scope, $name, $value);
if (!function_exists('addHtmlAttribute')) {
/**
* Add HTML attributes by scope
*
* @param $scope
* @param $name
* @param $value
*
* @return void
*/
function addHtmlAttribute($scope, $name, $value)
{
theme()->addHtmlAttribute($scope, $name, $value);
}
}
}
if (!function_exists('addHtmlAttributes')) {
/**
* Add multiple HTML attributes by scope
*
* @param $scope
* @param $attributes
*
* @return void
*/
function addHtmlAttributes($scope, $attributes)
{
theme()->addHtmlAttributes($scope, $attributes);
if (!function_exists('addHtmlAttributes')) {
/**
* Add multiple HTML attributes by scope
*
* @param $scope
* @param $attributes
*
* @return void
*/
function addHtmlAttributes($scope, $attributes)
{
theme()->addHtmlAttributes($scope, $attributes);
}
}
}
if (!function_exists('addHtmlClass')) {
/**
* Add HTML class by scope
*
* @param $scope
* @param $value
*
* @return void
*/
function addHtmlClass($scope, $value)
{
theme()->addHtmlClass($scope, $value);
if (!function_exists('addHtmlClass')) {
/**
* Add HTML class by scope
*
* @param $scope
* @param $value
*
* @return void
*/
function addHtmlClass($scope, $value)
{
theme()->addHtmlClass($scope, $value);
}
}
}
if (!function_exists('printHtmlAttributes')) {
/**
* Print HTML attributes for the HTML template
*
* @param $scope
*
* @return string
*/
function printHtmlAttributes($scope)
{
return theme()->printHtmlAttributes($scope);
if (!function_exists('printHtmlAttributes')) {
/**
* Print HTML attributes for the HTML template
*
* @param $scope
*
* @return string
*/
function printHtmlAttributes($scope)
{
return theme()->printHtmlAttributes($scope);
}
}
}
if (!function_exists('printHtmlClasses')) {
/**
* Print HTML classes for the HTML template
*
* @param $scope
* @param $full
*
* @return string
*/
function printHtmlClasses($scope, $full = true)
{
return theme()->printHtmlClasses($scope, $full);
if (!function_exists('printHtmlClasses')) {
/**
* Print HTML classes for the HTML template
*
* @param $scope
* @param $full
*
* @return string
*/
function printHtmlClasses($scope, $full = true)
{
return theme()->printHtmlClasses($scope, $full);
}
}
}
if (!function_exists('getSvgIcon')) {
/**
* Get SVG icon content
*
* @param $path
* @param $classNames
* @param $folder
*
* @return string
*/
function getSvgIcon($path, $classNames = 'svg-icon', $folder = 'assets/media/icons/')
{
return theme()->getSvgIcon($path, $classNames, $folder);
if (!function_exists('getSvgIcon')) {
/**
* Get SVG icon content
*
* @param $path
* @param $classNames
* @param $folder
*
* @return string
*/
function getSvgIcon($path, $classNames = 'svg-icon', $folder = 'assets/media/icons/')
{
return theme()->getSvgIcon($path, $classNames, $folder);
}
}
}
if (!function_exists('setModeSwitch')) {
/**
* Set dark mode enabled status
*
* @param $flag
*
* @return void
*/
function setModeSwitch($flag)
{
if (!function_exists('setModeSwitch')) {
/**
* Set dark mode enabled status
*
* @param $flag
*
* @return void
*/
function setModeSwitch($flag)
{
}
}
}
if (!function_exists('isModeSwitchEnabled')) {
/**
* Check dark mode status
*
* @return void
*/
function isModeSwitchEnabled()
{
if (!function_exists('isModeSwitchEnabled')) {
/**
* Check dark mode status
*
* @return void
*/
function isModeSwitchEnabled()
{
}
}
}
if (!function_exists('setModeDefault')) {
/**
* Set the mode to dark or light
*
* @param $mode
*
* @return void
*/
function setModeDefault($mode)
{
if (!function_exists('setModeDefault')) {
/**
* Set the mode to dark or light
*
* @param $mode
*
* @return void
*/
function setModeDefault($mode)
{
}
}
}
if (!function_exists('getModeDefault')) {
/**
* Get current mode
*
* @return void
*/
function getModeDefault()
{
if (!function_exists('getModeDefault')) {
/**
* Get current mode
*
* @return void
*/
function getModeDefault()
{
}
}
}
if (!function_exists('setDirection')) {
/**
* Set style direction
*
* @param $direction
*
* @return void
*/
function setDirection($direction)
{
if (!function_exists('setDirection')) {
/**
* Set style direction
*
* @param $direction
*
* @return void
*/
function setDirection($direction)
{
}
}
}
if (!function_exists('getDirection')) {
/**
* Get style direction
*
* @return void
*/
function getDirection()
{
if (!function_exists('getDirection')) {
/**
* Get style direction
*
* @return void
*/
function getDirection()
{
}
}
}
if (!function_exists('isRtlDirection')) {
/**
* Check if style direction is RTL
*
* @return void
*/
function isRtlDirection()
{
if (!function_exists('isRtlDirection')) {
/**
* Check if style direction is RTL
*
* @return void
*/
function isRtlDirection()
{
}
}
}
if (!function_exists('extendCssFilename')) {
/**
* Extend CSS file name with RTL or dark mode
*
* @param $path
*
* @return void
*/
function extendCssFilename($path)
{
if (!function_exists('extendCssFilename')) {
/**
* Extend CSS file name with RTL or dark mode
*
* @param $path
*
* @return void
*/
function extendCssFilename($path)
{
}
}
}
if (!function_exists('includeFavicon')) {
/**
* Include favicon from settings
*
* @return string
*/
function includeFavicon()
{
return theme()->includeFavicon();
if (!function_exists('includeFavicon')) {
/**
* Include favicon from settings
*
* @return string
*/
function includeFavicon()
{
return theme()->includeFavicon();
}
}
}
if (!function_exists('includeFonts')) {
/**
* Include the fonts from settings
*
* @return string
*/
function includeFonts()
{
return theme()->includeFonts();
if (!function_exists('includeFonts')) {
/**
* Include the fonts from settings
*
* @return string
*/
function includeFonts()
{
return theme()->includeFonts();
}
}
}
if (!function_exists('getGlobalAssets')) {
/**
* Get the global assets
*
* @param $type
*
* @return array
*/
function getGlobalAssets($type = 'js')
{
return theme()->getGlobalAssets($type);
if (!function_exists('getGlobalAssets')) {
/**
* Get the global assets
*
* @param $type
*
* @return array
*/
function getGlobalAssets($type = 'js')
{
return theme()->getGlobalAssets($type);
}
}
}
if (!function_exists('addVendors')) {
/**
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
*
* @param $vendors
*
* @return void
*/
function addVendors($vendors)
{
theme()->addVendors($vendors);
if (!function_exists('addVendors')) {
/**
* Add multiple vendors to the page by name. Refer to settings KT_THEME_VENDORS
*
* @param $vendors
*
* @return void
*/
function addVendors($vendors)
{
theme()->addVendors($vendors);
}
}
}
if (!function_exists('addVendor')) {
/**
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
*
* @param $vendor
*
* @return void
*/
function addVendor($vendor)
{
theme()->addVendor($vendor);
if (!function_exists('addVendor')) {
/**
* Add single vendor to the page by name. Refer to settings KT_THEME_VENDORS
*
* @param $vendor
*
* @return void
*/
function addVendor($vendor)
{
theme()->addVendor($vendor);
}
}
}
if (!function_exists('addJavascriptFile')) {
/**
* Add custom javascript file to the page
*
* @param $file
*
* @return void
*/
function addJavascriptFile($file)
{
theme()->addJavascriptFile($file);
if (!function_exists('addJavascriptFile')) {
/**
* Add custom javascript file to the page
*
* @param $file
*
* @return void
*/
function addJavascriptFile($file)
{
theme()->addJavascriptFile($file);
}
}
}
if (!function_exists('addCssFile')) {
/**
* Add custom CSS file to the page
*
* @param $file
*
* @return void
*/
function addCssFile($file)
{
theme()->addCssFile($file);
if (!function_exists('addCssFile')) {
/**
* Add custom CSS file to the page
*
* @param $file
*
* @return void
*/
function addCssFile($file)
{
theme()->addCssFile($file);
}
}
}
if (!function_exists('getVendors')) {
/**
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
*
* @param $type
*
* @return array
*/
function getVendors($type)
{
return theme()->getVendors($type);
if (!function_exists('getVendors')) {
/**
* Get vendor files from settings. Refer to settings KT_THEME_VENDORS
*
* @param $type
*
* @return array
*/
function getVendors($type)
{
return theme()->getVendors($type);
}
}
}
if (!function_exists('getCustomJs')) {
/**
* Get custom js files from the settings
*
* @return array
*/
function getCustomJs()
{
return theme()->getCustomJs();
if (!function_exists('getCustomJs')) {
/**
* Get custom js files from the settings
*
* @return array
*/
function getCustomJs()
{
return theme()->getCustomJs();
}
}
}
if (!function_exists('getCustomCss')) {
/**
* Get custom css files from the settings
*
* @return array
*/
function getCustomCss()
{
return theme()->getCustomCss();
if (!function_exists('getCustomCss')) {
/**
* Get custom css files from the settings
*
* @return array
*/
function getCustomCss()
{
return theme()->getCustomCss();
}
}
}
if (!function_exists('getHtmlAttribute')) {
/**
* Get HTML attribute based on the scope
*
* @param $scope
* @param $attribute
*
* @return array
*/
function getHtmlAttribute($scope, $attribute)
{
return theme()->getHtmlAttribute($scope, $attribute);
if (!function_exists('getHtmlAttribute')) {
/**
* Get HTML attribute based on the scope
*
* @param $scope
* @param $attribute
*
* @return array
*/
function getHtmlAttribute($scope, $attribute)
{
return theme()->getHtmlAttribute($scope, $attribute);
}
}
}
if (!function_exists('isUrl')) {
/**
* Get HTML attribute based on the scope
*
* @param $url
*
* @return mixed
*/
function isUrl($url)
{
return filter_var($url, FILTER_VALIDATE_URL);
if (!function_exists('isUrl')) {
/**
* Get HTML attribute based on the scope
*
* @param $url
*
* @return mixed
*/
function isUrl($url)
{
return filter_var($url, FILTER_VALIDATE_URL);
}
}
}
if (!function_exists('image')) {
/**
* Get image url by path
*
* @param $path
*
* @return string
*/
function image($path)
{
return asset('assets/media/'.$path);
if (!function_exists('image')) {
/**
* Get image url by path
*
* @param $path
*
* @return string
*/
function image($path)
{
return asset('assets/media/' . $path);
}
}
}
if (!function_exists('getIcon')) {
/**
* Get icon
*
* @param $path
*
* @return string
*/
function getIcon($name, $class = '', $type = '')
{
return theme()->getIcon($name, $class, $type);
if (!function_exists('getIcon')) {
/**
* Get icon
*
* @param $path
*
* @return string
*/
function getIcon($name, $class = '', $type = '')
{
return theme()->getIcon($name, $class, $type);
}
}
function verify_user($id, $passwd, $SERVER_ADDR, $IPUserManager, $portUserManager, $appId)
{
$USERMANPROG = "user_verification.php";
$sock = fsockopen("tcp://" . $IPUserManager, $portUserManager, $errno, $errstr, 30);
if (!$sock) die("$errstr ($errno)\n");
$data = "appsid=" . urlencode($appId) . "&loginid=" . urlencode($id) . "&passwd=" . urlencode($passwd) . "&addr=" . $SERVER_ADDR . "&version=2";
//echo "data: $data <BR>";
fwrite($sock, "POST /user_verification_dev.php HTTP/1.0\r\n");
fwrite($sock, "Host: $IPUserManager\r\n");
fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n");
fwrite($sock, "Content-length: " . strlen($data) . "\r\n");
fwrite($sock, "Accept: */*\r\n");
fwrite($sock, "\r\n");
fwrite($sock, "$data\r\n");
fwrite($sock, "\r\n");
$headers = "";
while ($str = trim(fgets($sock, 4096))) $headers .= "$str\n";
$body = "";
while (!feof($sock)) $body .= fgets($sock, 4096);
fclose($sock);
return decompress($body);
}
function getAllowableScript($sessionMenu)
{
//$sessionMenu = $_SESSION['MENU'];
if (!empty($sessionMenu)) {
$tempMenuArrayLine = explode('-', $sessionMenu);
//print_r($tempMenuArrayLine);
if (count($tempMenuArrayLine) > 0) {
foreach ($tempMenuArrayLine as $tkey => $tval) {
$tempMenuArray = explode('|', $tval);
if (count($tempMenuArray) > 0) {
foreach ($tempMenuArray as $mkey => $mval) {
[$menukey, $menuval] = explode('>', $mval);
if ($menukey === 'LINK') {
$SCRIPT_ALLOW[$menuval] = 1;
}
//$menu[$menuCounter][$menukey] = $menuval;
}
//$menuCounter++;
}
}
}
}
return $SCRIPT_ALLOW;
}
function decompress($data)
{
$text = '';
$total = strlen($data);
for ($j = 0; $j < $total; $j = $j + 2) {
$text .= chr(hexdec(substr($data, $j, 2)));
}
return $text;
}
function compress($data)
{
$text = '';
$total = strlen($data);
for ($i = 0; $i < $total; $i++) {
$temp = dechex(ord(substr($data, $i, 1)));
if (strlen($temp) < 2) {
$temp = '0' . $temp;
}
$text .= $temp;
}
return $text;
}
function jsonToView($jsonText = '')
{
$arr = json_decode($jsonText, true);
$html = "";
if ($arr && is_array($arr)) {
$html .= _arrayToHtmlTableRecursive($arr);
}
return $html;
}
function _arrayToHtmlTableRecursive($arr)
{
$str = "<table><tbody>";
foreach ($arr as $key => $val) {
$str .= "<tr>";
$str .= "<td>$key</td>";
$str .= "<td>";
if (is_array($val)) {
if (!empty($val)) {
$str .= _arrayToHtmlTableRecursive($val);
}
} else {
$str .= "<strong>$val</strong>";
}
$str .= "</td></tr>";
}
$str .= "</tbody></table>";
return $str;
}
}

View File

@ -0,0 +1,48 @@
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller as Controller;
class ApiController extends Controller
{
/**
* success response method.
*
* @return \Illuminate\Http\Response
*/
public function sendResponse($result, $message,$execution_time='',$generated_at='', $code = 200)
{
$response = [
'success' => true,
'data' => $result,
'message' => $message,
'transaction_id' => uniqid(),
'execution_time' => $execution_time,
'genrated_at' => $generated_at
];
return response()->json($response, $code);
}
/**
* return error response.
*
* @return \Illuminate\Http\Response
*/
public function sendError($error, $errorMessages = [], $code = 404)
{
$response = [
'success' => false,
'message' => $error,
];
if (!empty($errorMessages)) {
$response['data'] = $errorMessages;
}
return response()->json($response, $code);
}
}

View File

@ -1,58 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\LoginRequest;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class AuthenticatedSessionController extends Controller
{
/**
* Display the login view.
*
* @return \Illuminate\View\View
*/
public function create()
{
addJavascriptFile('assets/js/custom/authentication/sign-in/general.js');
return view('pages.auth.login');
}
/**
* Handle an incoming authentication request.
*
* @param \App\Http\Requests\Auth\LoginRequest $request
*
* @return \Illuminate\Http\RedirectResponse
*/
public function store(LoginRequest $request)
{
$request->authenticate();
$request->session()->regenerate();
return redirect()->intended(RouteServiceProvider::HOME);
}
/**
* Destroy an authenticated session.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy(Request $request)
{
Auth::guard('web')->logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/');
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;
class ConfirmablePasswordController extends Controller
{
/**
* Show the confirm password view.
*
* @return \Illuminate\View\View
*/
public function show()
{
return view('pages.auth.confirm-password');
}
/**
* Confirm the user's password.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function store(Request $request)
{
if (! Auth::guard('web')->validate([
'email' => $request->user()->email,
'password' => $request->password,
])) {
throw ValidationException::withMessages([
'password' => __('auth.password'),
]);
}
$request->session()->put('auth.password_confirmed_at', time());
return redirect()->intended(RouteServiceProvider::HOME);
}
}

View File

@ -1,27 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
class EmailVerificationNotificationController extends Controller
{
/**
* Send a new email verification notification.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*/
public function store(Request $request)
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME);
}
$request->user()->sendEmailVerificationNotification();
return back()->with('status', 'verification-link-sent');
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
class EmailVerificationPromptController extends Controller
{
/**
* Display the email verification prompt.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function __invoke(Request $request)
{
return $request->user()->hasVerifiedEmail()
? redirect()->intended(RouteServiceProvider::HOME)
: view('pages.auth.verify-email');
}
}

View File

@ -1,65 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
class NewPasswordController extends Controller
{
/**
* Display the password reset view.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View
*/
public function create(Request $request)
{
return view('pages.auth.reset-password', ['request' => $request]);
}
/**
* Handle an incoming new password request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request)
{
$request->validate([
'token' => ['required'],
'email' => ['required', 'email'],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
]);
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function ($user) use ($request) {
$user->forceFill([
'password' => Hash::make($request->password),
'remember_token' => Str::random(60),
])->save();
event(new PasswordReset($user));
}
);
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
return $status == Password::PASSWORD_RESET
? redirect()->route('login')->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;
class PasswordResetLinkController extends Controller
{
/**
* Display the password reset link request view.
*
* @return \Illuminate\View\View
*/
public function create()
{
addJavascriptFile('assets/js/custom/authentication/reset-password/reset-password.js');
return view('pages.auth.forgot-password');
}
/**
* Handle an incoming password reset link request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request)
{
$request->validate([
'email' => ['required', 'email'],
]);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$status = Password::sendResetLink(
$request->only('email')
);
return $status == Password::RESET_LINK_SENT
? back()->with('status', __($status))
: back()->withInput($request->only('email'))
->withErrors(['email' => __($status)]);
}
}

View File

@ -1,56 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Registered;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules;
class RegisteredUserController extends Controller
{
/**
* Display the registration view.
*
* @return \Illuminate\View\View
*/
public function create()
{
addJavascriptFile('assets/js/custom/authentication/sign-up/general.js');
return view('pages.auth.register');
}
/**
* Handle an incoming registration request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
*
* @throws \Illuminate\Validation\ValidationException
*/
public function store(Request $request)
{
$request->validate([
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
]);
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($request->password),
]);
event(new Registered($user));
Auth::login($user);
return redirect(RouteServiceProvider::HOME);
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Auth\Events\Verified;
use Illuminate\Foundation\Auth\EmailVerificationRequest;
class VerifyEmailController extends Controller
{
/**
* Mark the authenticated user's email address as verified.
*
* @param \Illuminate\Foundation\Auth\EmailVerificationRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function __invoke(EmailVerificationRequest $request)
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
}
if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
}
return redirect()->intended(RouteServiceProvider::HOME.'?verified=1');
}
}

View File

@ -1,123 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\DirectoratDataTable;
use App\Http\Requests\StoreDirectoratRequest;
use App\Http\Requests\UpdateDirectoratRequest;
use App\Models\Directorat;
use Illuminate\Http\Request;
use Spatie\Activitylog\Facades\CauserResolver;
class DirectoratController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
//CauserResolver::setCauser($this->user);
}
/**
* Display a listing of the resource.
*/
public function index(DirectoratDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
return $dataTable->render('pages.masters.directorat.index');
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreDirectoratRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Directorat...
if($validated){
try{
Directorat::create($validated);
//return redirect()->route('directorat.index')->with('success', 'Directorat created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Directorat created successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'Directorat created failed.');
echo json_encode(['status' => 'error', 'message' => 'Directorat created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Directorat $directorat)
{
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$directorat = Directorat::find($id);
echo json_encode($directorat);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateDirectoratRequest $request, Directorat $directorat)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the Directorat...
if($validated){
try{
CauserResolver::setCauser($this->user);
$directorat->update($validated);
//return redirect()->route('directorat.index')->with('success', 'Directorat updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Directorat updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'Directorat updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Directorat updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Directorat $directorat){
$directorat->delete();
echo json_encode(['status' => 'success', 'message' => 'Directorat deleted successfully.']);
}
}

View File

@ -1,179 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\DocumentDataTable;
use App\Http\Requests\StoreDocumentRequest;
use App\Http\Requests\UpdateDocumentRequest;
use App\Models\Directorat;
use App\Models\Document;
use App\Models\DocumentDetail;
use App\Models\DocumentType;
use App\Models\Job;
use App\Models\SpecialCode;
use App\Models\SubDirectorat;
use App\Models\SubJob;
use App\Models\SubSubJob;
use Exception;
use Illuminate\Http\Request;
use Spatie\Activitylog\Facades\CauserResolver;
class DocumentController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
//CauserResolver::setCauser($this->user);
}
/**
* Display a listing of the resource.
*/
public function index(DocumentDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('app.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
return $dataTable->render('pages.app.document.index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
/*if (is_null($this->user) || !$this->user->can('app.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
addVendor('chained-select');
$directorat = Directorat::all();
$special_code = SpecialCode::all();
$document_type = DocumentType::all();
return view('pages.app.document.create', compact('directorat', 'special_code', 'document_type'));
}
/**
* Store a newly created resource in storage.
*/
public function store(StoreDocumentRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('app.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Document...
if ($validated) {
$validated['sequence'] = 1;
try {
$created = Document::create($validated);
if ($created) {
$detail = [
'document_id' => $created->id,
'document_type_id' => $request->document_type_id,
'tanggal_upload' => date('Y-m-d'),
'tanggal_dokumen' => $request->tanggal_dokumen,
'nomor_dokumen' => $request->nomor_dokumen,
'perihal' => $request->perihal,
'kode_cabang' => $request->kode_cabang,
'jumlah_halaman' => $request->jumlah_halaman,
'custom_field_1' => $request->custom_field_1,
'custom_field_2' => $request->custom_field_2,
'custom_field_3' => $request->custom_field_3,
'custom_field_4' => $request->custom_field_4,
'nama_nasabah' => $request->nama_nasabah,
'no_rekening' => $request->no_rekening,
'no_cif' => $request->no_cif,
'group' => $request->group,
];
DocumentDetail::create($detail);
}
return redirect()->route('document.index')->with('success', 'Document created successfully.');
} catch (Exception $e) {
return redirect()->route('document.index')->with('error', 'Document created failed.');
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Document $documents)
{
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$document = Document::find($id);
$directorat = Directorat::all();
$sub_directorat = SubDirectorat::where('directorat_id', $document->directorat_id)->get();
$job = Job::where('sub_directorat_id', $document->sub_directorat_id)->get();
$sub_job = SubJob::where('job_id', $document->job_id)->get();
$sub_sub_job = SubSubJob::where('sub_job_id', $document->sub_job_id)->get();
$special_code = SpecialCode::all();
$document_type = DocumentType::all();
return view('pages.app.document.edit', compact('document', 'directorat', 'sub_directorat', 'job', 'sub_job', 'sub_sub_job', 'special_code', 'document_type'));
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateDocumentRequest $request, Document $documents)
{
/*if (is_null($this->user) || !$this->user->can('app.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the Document...
if ($validated) {
try {
$document = Document::find($request->id);
$update = $document->update($validated);
return redirect()->route('document.index')->with('success', 'Document updated successfully.');
} catch (Exception $e) {
return redirect()->route('document.index')->with('error', 'Document updated failed.');
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Request $request)
{
$documents = Document::find($request->document);
$documents->delete();
echo json_encode(['status' => 'success', 'message' => 'Document deleted successfully.']);
}
}

View File

@ -1,118 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\DocumentTypeDataTable;
use App\Http\Requests\StoreDocumentTypeRequest;
use App\Http\Requests\UpdateDocumentTypeRequest;
use App\Models\DocumentType;
use Illuminate\Http\Request;
use Spatie\Activitylog\Facades\CauserResolver;
class DocumentTypeController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
//CauserResolver::setCauser($this->user);
}
/**
* Display a listing of the resource.
*/
public function index(DocumentTypeDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
return $dataTable->render('pages.masters.document-type.index');
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreDocumentTypeRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Document Type...
if($validated){
try{
DocumentType::create($validated);
echo json_encode(['status' => 'success', 'message' => 'Document Type created successfully.']);
}catch(\Exception $e){
echo json_encode(['status' => 'error', 'message' => 'Document Type created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(DocumentType $document_type)
{
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$document_type = DocumentType::find($id);
echo json_encode($document_type);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateDocumentTypeRequest $request, DocumentType $document_type)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the Directorat...
if($validated){
try{
$document_type->update($validated);
echo json_encode(['status' => 'success', 'message' => 'Document Type updated successfully.']);
}catch(\Exception $e){
echo json_encode(['status' => 'error', 'message' => 'Document Type updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(DocumentType $document_type){
$document_type->delete();
echo json_encode(['status' => 'success', 'message' => 'Document Type deleted successfully.']);
}
}

View File

@ -1,139 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\JobDataTable;
use App\Http\Requests\StoreJobRequest;
use App\Http\Requests\UpdateJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use Illuminate\Http\Request;
class JobController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*/
public function index(JobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
// Add Vendor
addVendor('chained-select');
if(isset($request->sub_directorat_id) && !empty($request->sub_directorat_id)) {
$this->show($request);
return;
}
$directorat = Directorat::all();
return $dataTable->render('pages.masters.job.index', compact('directorat'));
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Job...
if($validated){
try{
Job::create($validated);
//return redirect()->route('job.index')->with('success', 'Job created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'Job created failed.');
echo json_encode(['status' => 'error', 'message' => 'Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Request $request)
{
$jobs = Job::where('sub_directorat_id', $request->sub_directorat_id)->get();
$data = [];
foreach ($jobs as $row) {
$result = [
$row->id => $row->name,
];
$data[] = $result;
}
echo json_encode($data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$job = Job::find($id);
echo json_encode($job);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateJobRequest $request, Job $job)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the Job...
if($validated){
try{
$job->update($validated);
//return redirect()->route('job.index')->with('success', 'Job updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Job updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'Job updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Job updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Job $job){
$job->delete();
echo json_encode(['status' => 'success', 'message' => 'Job deleted successfully.']);
//return redirect()->route('job.index')->with('success', 'Job deleted successfully.');
}
}

View File

@ -1,35 +0,0 @@
<?php
namespace App\Http\Controllers\Logs;
use App\DataTables\Logs\AuditLogsDataTable;
use App\Http\Controllers\Controller;
use Spatie\Activitylog\Models\Activity;
class AuditLogsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(AuditLogsDataTable $dataTable)
{
return $dataTable->render('pages.log.audit.index');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$activity = Activity::find($id);
// Delete from db
$activity->delete();
}
}

View File

@ -1,32 +0,0 @@
<?php
namespace App\Http\Controllers\Logs;
use App\DataTables\Logs\SystemLogsDataTable;
use App\Http\Controllers\Controller;
use Jackiedo\LogReader\LogReader;
class SystemLogsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(SystemLogsDataTable $dataTable)
{
return $dataTable->render('pages.log.system.index');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return \Illuminate\Http\Response
*/
public function destroy($id, LogReader $logReader)
{
return $logReader->find($id)->delete();
}
}

View File

@ -1,118 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\SpecialCodeDataTable;
use App\Http\Requests\StoreSpecialCodeRequest;
use App\Http\Requests\UpdateSpecialCodeRequest;
use App\Models\SpecialCode;
use Illuminate\Http\Request;
use Spatie\Activitylog\Facades\CauserResolver;
class SpecialCodeController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
//CauserResolver::setCauser($this->user);
}
/**
* Display a listing of the resource.
*/
public function index(SpecialCodeDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
return $dataTable->render('pages.masters.special-code.index');
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSpecialCodeRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the Special Code...
if($validated){
try{
SpecialCode::create($validated);
echo json_encode(['status' => 'success', 'message' => 'Special Code created successfully.']);
}catch(\Exception $e){
echo json_encode(['status' => 'error', 'message' => 'Special Code created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(SpecialCode $special_code)
{
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$special_code = SpecialCode::find($id);
echo json_encode($special_code);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateSpecialCodeRequest $request, SpecialCode $special_code)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the Directorat...
if($validated){
try{
$special_code->update($validated);
echo json_encode(['status' => 'success', 'message' => 'Special Code updated successfully.']);
}catch(\Exception $e){
echo json_encode(['status' => 'error', 'message' => 'Special Code updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(SpecialCode $special_code){
$special_code->delete();
echo json_encode(['status' => 'success', 'message' => 'Special Code deleted successfully.']);
}
}

View File

@ -1,138 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\SubDirectoratDataTable;
use App\Http\Requests\StoreSubDirectoratRequest;
use App\Http\Requests\UpdateSubDirectoratRequest;
use App\Models\Directorat;
use App\Models\SubDirectorat;
use Illuminate\Http\Request;
class SubDirectoratController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*/
public function index(SubDirectoratDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
if(isset($request->directorat_id) && !empty($request->directorat_id)) {
$this->show($request);
return;
}
$directorat = Directorat::all();
return $dataTable->render('pages.masters.sub-directorat.index', compact('directorat'));
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubDirectoratRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubDirectorat...
if($validated){
try{
SubDirectorat::create($validated);
//return redirect()->route('directorat.index')->with('success', 'SubDirectorat created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat created successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'SubDirectorat created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Request $request)
{
$subdirectorats = SubDirectorat::where('directorat_id', $request->directorat_id)->get();
$data = [];
foreach ($subdirectorats as $row) {
$result = [
$row->id => $row->name,
];
$data[] = $result;
}
echo json_encode($data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$subDirectorat = SubDirectorat::find($id);
echo json_encode($subDirectorat);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateSubDirectoratRequest $request, SubDirectorat $subDirectorat)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the SubDirectorat...
if($validated){
try{
$subDirectorat->update($validated);
//return redirect()->route('directorat.index')->with('success', 'SubDirectorat updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('directorat.index')->with('error', 'SubDirectorat updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Directorat updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(SubDirectorat $subDirectorat){
$subDirectorat->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Directorat deleted successfully.']);
//return redirect()->route('sub-directorat.index')->with('success', 'Sub Directorat deleted successfully.');
}
}

View File

@ -1,139 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\SubJobDataTable;
use App\Http\Requests\StoreSubJobRequest;
use App\Http\Requests\UpdateSubJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use App\Models\SubJob;
use Illuminate\Http\Request;
class SubJobController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*/
public function index(SubJobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
addVendor('chained-select');
if(isset($request->job_id) && !empty($request->job_id)) {
$this->show($request);
return;
}
$directorat = Directorat::all();
return $dataTable->render('pages.masters.sub-job.index', compact('directorat'));
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubJob...
if($validated){
try{
SubJob::create($validated);
//return redirect()->route('job.index')->with('success', 'SubJob created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubJob created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Request $request)
{
$subJob = SubJob::where('job_id', $request->job_id)->get();
$data = [];
foreach ($subJob as $row) {
$result = [
$row->id => $row->name,
];
$data[] = $result;
}
echo json_encode($data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$subJob = SubJob::find($id);
echo json_encode($subJob);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateSubJobRequest $request, SubJob $subJob)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the SubJob...
if($validated){
try{
$subJob->update($validated);
//return redirect()->route('job.index')->with('success', 'SubJob updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Job updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubJob updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Job updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(SubJob $subJob){
$subJob->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Job deleted successfully.']);
//return redirect()->route('sub-job.index')->with('success', 'Sub Job deleted successfully.');
}
}

View File

@ -1,139 +0,0 @@
<?php
namespace App\Http\Controllers;
use App\DataTables\SubSubJobDataTable;
use App\Http\Requests\StoreSubSubJobRequest;
use App\Http\Requests\UpdateSubSubJobRequest;
use App\Models\Directorat;
use App\Models\Job;
use App\Models\SubSubJob;
use Illuminate\Http\Request;
class SubSubJobController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
//$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*/
public function index(SubSubJobDataTable $dataTable, Request $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
}*/
if(isset($request->sub_job_id) && !empty($request->sub_job_id)) {
$this->show($request);
return;
}
addVendor('chained-select');
$directorat = Directorat::all();
return $dataTable->render('pages.masters.sub-sub-job.index', compact('directorat'));
}
/**
* Show the form for creating a new resource.
*/
public function create(){}
/**
* Store a newly created resource in storage.
*/
public function store(StoreSubSubJobRequest $request)
{
/*if (is_null($this->user) || !$this->user->can('masters.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Store the SubSubJob...
if($validated){
try{
SubSubJob::create($validated);
//return redirect()->route('job.index')->with('success', 'SubSubJob created successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job created successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubSubJob created failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*/
public function show(Request $request)
{
$subSubJob = SubSubJob::where('sub_job_id', $request->sub_job_id)->get();
$data = [];
foreach ($subSubJob as $row) {
$result = [
$row->id => $row->name,
];
$data[] = $result;
}
echo json_encode($data);
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id){
$subJob = SubSubJob::find($id);
echo json_encode($subJob);
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateSubSubJobRequest $request, SubSubJob $subSubJob)
{
/*if (is_null($this->user) || !$this->user->can('masters.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any master data !');
}*/
// Validate the request...
$validated = $request->validated();
// Update the SubSubJob...
if($validated){
try{
$subSubJob->update($validated);
//return redirect()->route('job.index')->with('success', 'SubSubJob updated successfully.');
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job updated successfully.']);
}catch(\Exception $e){
//return redirect()->route('job.index')->with('error', 'SubSubJob updated failed.');
echo json_encode(['status' => 'error', 'message' => 'Sub Sub Job updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*/
public function destroy(SubSubJob $subSubJob){
$subSubJob->delete();
echo json_encode(['status' => 'success', 'message' => 'Sub Sub Job deleted successfully.']);
//return redirect()->route('sub-job.index')->with('success', 'Sub Sub Job deleted successfully.');
}
}

View File

@ -1,205 +0,0 @@
<?php
namespace App\Http\Controllers\Users;
use App\DataTables\Users\PermissionsDataTable;
use App\Http\Controllers\Controller;
use App\Models\PermissionGroup;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Models\Permission;
class PermissionsController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(PermissionsDataTable $dataTable)
{
/* if (is_null($this->user) || !$this->user->can('permission.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any permission !');
}*/
return $dataTable->render('pages.users.permissions.index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
/*if (is_null($this->user) || !$this->user->can('permission.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any permission !');
}*/
// Validation Data
$validate = $request->validate([
'name' => 'required|max:100|unique:permission_groups'
], [
'name.requried' => 'Please give a permission name'
]);
if($validate){
try{
// Process Data
$group = PermissionGroup::create(['name' => $request->name]);
$group_name = strtolower($request->name);
$data = [
$group_name.'.create',
$group_name.'.read',
$group_name.'.update',
$group_name.'.delete',
$group_name.'.authorize',
$group_name.'.report'
];
foreach($data as $permission){
Permission::create([
'name' => $permission,
'guard_name' => 'web',
'permission_group_id' => $group->id
]);
}
echo json_encode(['status' => 'success', 'message' => 'Permission created successfully.']);
}catch(\Exception $e){
echo json_encode(['status' => 'error', 'message' => 'Permission created failed.']);
}
}
return false;
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
/*if (is_null($this->user) || !$this->user->can('permission.update')) {
abort(403, 'Sorry !! You are Unauthorized to edit any permission !');
}*/
$permission = PermissionGroup::find($id);
echo json_encode($permission);
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
/* if (is_null($this->user) || !$this->user->can('permission.update')) {
abort(403, 'Sorry !! You are Unauthorized to edit any permission !');
}*/
// Validation Data
$validated = $request->validate([
'name' => 'required|max:100|unique:permission_groups,name,' . $id
], [
'name.requried' => 'Please give a permission name'
]);
if ($validated) {
try {
// Process Data
$group = PermissionGroup::find($id);
$group->name = $request->name;
if($group->save()){
$group_name = strtolower($request->name);
$permissions = Permission::where('permission_group_id', $group->id)->get();
$data = [
$group_name . '.create',
$group_name . '.read',
$group_name . '.update',
$group_name . '.delete',
$group_name . '.authorize',
$group_name . '.report'
];
$i = 0;
foreach($permissions as $permission){
$permission->name = $data[$i];
$permission->save();
$i++;
}
}
echo json_encode(['status' => 'success', 'message' => 'Permission updated successfully.']);
} catch (\Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Permission updated failed.']);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
/*if (is_null($this->user) || !$this->user->can('permission.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any role !');
}*/
$permission = PermissionGroup::find($id);
if (!is_null($permission)) {
if($permission->delete()){
Permission::where('permission_group_id',$id)->delete();
}
}
echo json_encode(['status' => 'success', 'message' => 'Permission deleted successfully.']);
}
}

View File

@ -1,190 +0,0 @@
<?php
namespace App\Http\Controllers\Users;
use App\DataTables\Users\RolesDataTable;
use App\Http\Controllers\Controller;
use App\Models\PermissionGroup;
use App\Models\User;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Spatie\Permission\Models\Role;
use App\Models\Permission;
class RolesController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(RolesDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('role.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any role !');
}*/
$permissiongroups = PermissionGroup::all();
return $dataTable->render('pages.users.roles.index', compact('permissiongroups'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function store(Request $request)
{
/*if (is_null($this->user) || !$this->user->can('role.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any role !');
}*/
// Validation Data
$validated = $request->validate([
'name' => 'required|max:100|unique:roles'
], [
'name.requried' => 'Please give a role name'
]);
if ($validated) {
try {
// Process Data
$role = Role::create(['name' => $request->name, 'guard_name' => 'web']);
$permissions = $request->input('permissions');
if (!empty($permissions)) {
$role = Role::find($role->id);
$role->syncPermissions($permissions);
}
echo json_encode(['status' => 'success', 'message' => 'Role Created Successfully']);
} catch (Exception $e) {
echo json_encode(['status' => 'error', 'message' => 'Role Created Failed']);
}
}
return false;
}
/**
* Display the specified resource.
*
* @param int $id
*
* @return Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Response
*/
public function edit($id)
{
/* if (is_null($this->user) || !$this->user->can('role.update')) {
abort(403, 'Sorry !! You are Unauthorized to edit any role !');
}*/
$role = Role::findById($id, 'web');
$permissions = Permission::all();
$permissiongroups = PermissionGroup::all();
$_array = [
'role' => $role,
'permissions' => $permissions,
'permissiongroups' => $permissiongroups
];
return view('pages.users.roles.edit', $_array);
}
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
*
* @return Response
*/
public function update(Request $request, $id)
{
/* if (is_null($this->user) || !$this->user->can('role.update')) {
abort(403, 'Sorry !! You are Unauthorized to edit any role !');
}*/
// Validation Data
$request->validate([
'name' => 'required|max:100|unique:roles,name,' . $id
], [
'name.requried' => 'Please give a role name'
]);
$role = Role::findById($id, 'web');
$permissions = $request->input('permissions');
$role->name = $request->name;
$role->save();
if (!empty($permissions)) {
$role->syncPermissions($permissions);
}
session()->flash('success', 'Role has been updated !!');
return redirect()->route('user.roles.index');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return Response
*/
public function destroy($id)
{
/*if (is_null($this->user) || !$this->user->can('role.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any role !');
}*/
$role = Role::findById($id, 'web');
if (!is_null($role)) {
$role->delete();
}
session()->flash('success', 'Role has been deleted !!');
return redirect()->route('user.roles.index');
}
}

View File

@ -1,238 +0,0 @@
<?php
namespace App\Http\Controllers\Users;
use App\DataTables\Users\UsersDataTable;
use App\Models\Directorat;
use App\Models\User;
use App\Http\Controllers\Controller;
use App\Models\UserInfo;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use App\Models\Permission;
use Spatie\Permission\Models\Role;
class UsersController extends Controller
{
public $user;
public function __construct()
{
$this->middleware(function ($request, $next) {
$this->user = Auth::guard('web')->user();
return $next($request);
});
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(UsersDataTable $dataTable)
{
/*if (is_null($this->user) || !$this->user->can('user.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any users !');
}*/
addVendor('chained-select');
$directorat = Directorat::all();
$roles = Role::all();
return $dataTable->render('pages.users.users.index', compact('directorat', 'roles'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
/* if (is_null($this->user) || !$this->user->can('user.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any users !');
}*/
$roles = Role::all();
return view('pages.users.create', compact('roles'));
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function store(Request $request)
{
/* if (is_null($this->user) || !$this->user->can('user.create')) {
abort(403, 'Sorry !! You are Unauthorized to create any users !');
}*/
// Validation Data
$request->password = 'bagbag';
$validated = $request->validate([
'name' => 'required|max:50',
'email' => 'required|max:100|email|unique:users'
]);
if ($validated) {
try {
// Create New User
$user = new User();
$user->name = $request->name;
$user->email = $request->email;
$user->directorat_id = $request->directorat_id;
$user->sub_directorat_id = $request->sub_directorat_id;
$user->password = Hash::make($request->password);
$user->save();
if ($request->roles) {
$user->assignRole($request->roles);
}
echo json_encode([
'status' => 'success',
'message' => 'User Created Successfully'
]);
} catch (Exception $e) {
echo json_encode([
'status' => 'error',
'message' => $e->getMessage()
]);
}
}
return false;
}
/**
* Display the specified resource.
*
* @param int $id
*
* @return Response
*/
public function show($id)
{
/*if (is_null($this->user) || !$this->user->can('user.read')) {
abort(403, 'Sorry !! You are Unauthorized to view any users !');
}*/
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Response
*/
public function edit($id)
{
/*if (is_null($this->user) || !$this->user->can('user.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any users !');
}*/
$user = User::find($id);
$roles = $user->roles;
echo json_encode([
'status' => 'success',
'data' => $user,
'roles' => $roles
]);
}
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param int $id
*
* @return Response
*/
public function update(Request $request, $id)
{
/* if (is_null($this->user) || !$this->user->can('user.update')) {
abort(403, 'Sorry !! You are Unauthorized to update any users !');
}*/
// Create New User
$user = User::find($id);
// Validation Data
if ($request->password !== '') {
$validated = $request->validate([
'name' => 'required|max:50',
'email' => 'required|max:100|email|unique:users,email,' . $id,
'password' => 'nullable|min:6|confirmed'
]);
} else {
$validated = $request->validate([
'name' => 'required|max:50',
'email' => 'required|max:100|email|unique:users,email,' . $id
]);
}
if ($validated) {
try {
$user->name = $request->name;
$user->email = $request->email;
$user->directorat_id = $request->directorat_id;
$user->sub_directorat_id = $request->sub_directorat_id;
if ($request->password) {
$user->password = Hash::make($request->password);
}
$user->save();
$user->roles()->detach();
if ($request->roles) {
$user->assignRole($request->roles);
}
echo json_encode([
'status' => 'success',
'message' => 'User Updated Successfully'
]);
} catch (Exception $e) {
echo json_encode([
'status' => 'error',
'message' => $e->getMessage()
]);
}
}
return false;
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return Response
*/
public function destroy(User $user)
{
/*if (is_null($this->user) || !$this->user->can('user.delete')) {
abort(403, 'Sorry !! You are Unauthorized to delete any users !');
}*/
$user->delete();
echo json_encode([
'status' => 'success',
'message' => 'User Deleted Successfully'
]);
}
}

View File

@ -20,7 +20,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class
];
/**
@ -39,7 +39,7 @@ class Kernel extends HttpKernel
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

View File

@ -0,0 +1,35 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
class ExecutionTimeMiddleware
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next)
{
// Start measuring time
$start = microtime(true);
$response = $next($request);
// End measuring time
$end = microtime(true);
// Calculate the execution time
$executionTime = $end - $start;
// Log or store the execution time as desired
// For example, you can log it using the Laravel logging facilities
$response->header('X-Execution-Time', $executionTime);
return $response;
}
}

View File

@ -1,93 +0,0 @@
<?php
namespace App\Http\Requests\Auth;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
class LoginRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'email' => ['required', 'string', 'email'],
'password' => ['required', 'string'],
];
}
/**
* Attempt to authenticate the request's credentials.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate()
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
/**
* Ensure the login request is not rate limited.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function ensureIsNotRateLimited()
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
}
event(new Lockout($this));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
]);
}
/**
* Get the rate limiting throttle key for the request.
*
* @return string
*/
public function throttleKey()
{
return Str::transliterate(Str::lower($this->input('email')).'|'.$this->ip());
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreDirectoratRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:directorats,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('directorat.index')->with('error', 'Directorat created failed.');
}
});
}
}

View File

@ -1,60 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreDocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize()
: bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules()
: array
{
return [
'kode' => 'required|string|unique:documents,kode',
'directorat_id' => 'required|integer|exists:directorats,id',
'sub_directorat_id' => 'required|integer|exists:sub_directorats,id',
'job_id' => 'required|integer|exists:jobs,id',
'sub_job_id' => 'required|integer|exists:sub_jobs,id',
'sub_sub_job_id' => 'required|integer|exists:sub_sub_jobs,id',
'special_code_id' => 'nullable|integer|exists:special_codes,id',
'no_urut' => 'nullable|integer|min:1|max:999',
'sequence' => 'nullable|integer|min:1|max:999',
'status' => 'nullable|integer',
'keterangan' => 'nullable|string|max:255',
'jenis_dokumen' => 'nullable|string|max:255',
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator)
: void
{
$validator->after(function (Validator $validator) {
if ($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash($value[0]);
}
return redirect()->route('document.index')->with('error', 'Document created failed.');
}
});
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreDocumentTypeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:document_types,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('document-type.index')->with('error', 'Document Type created failed.');
}
});
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'kode' => 'required|string|max:2|min:2|unique:jobs,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('job.index')->with('error', 'Job created failed.');
}
});
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreSpecialCodeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:special_codes,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('special-code.index')->with('error', 'Special Code created failed.');
}
});
}
}

View File

@ -1,48 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreSubDirectoratRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required',
'kode' => 'required|string|max:2|min:2|unique:sub_directorats',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('sub-directorat.index')->with('error', 'Sub Directorat created failed.');
}
});
}
}

View File

@ -1,50 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreSubJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'job_id' => 'required|exists:jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_jobs,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('job.index')->with('error', 'Sub Job created failed.');
}
});
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class StoreSubSubJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'job_id' => 'required|exists:jobs,id',
'sub_job_id' => 'required|exists:sub_jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_sub_jobs,kode',
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if ($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash($value[0]);
}
return redirect()->route('job.index')->with('error', 'Sub Sub Job created failed.');
}
});
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateDirectoratRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:directorats,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('directorat.index')->with('error', 'Directorat updated failed.');
}
});
}
}

View File

@ -1,60 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateDocumentRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize()
: bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules()
: array
{
return [
'kode' => 'required|string|unique:documents,kode,' . $this->id,
'directorat_id' => 'required|integer|exists:directorats,id',
'sub_directorat_id' => 'required|integer|exists:sub_directorats,id',
'job_id' => 'required|integer|exists:jobs,id',
'sub_job_id' => 'required|integer|exists:sub_jobs,id',
'sub_sub_job_id' => 'required|integer|exists:sub_sub_jobs,id',
'special_code_id' => 'nullable|integer|exists:special_codes,id',
'no_urut' => 'nullable|integer|min:1|max:999',
'sequence' => 'nullable|integer|min:1|max:999',
'status' => 'nullable|integer',
'keterangan' => 'nullable|string|max:255',
'jenis_dokumen' => 'nullable|string|max:255',
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator)
: void
{
$validator->after(function (Validator $validator) {
if ($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash($value[0]);
}
return redirect()->route('document.index')->with('error', 'Document updated failed.');
}
});
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateDocumentTypeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:document_types,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('document-type.index')->with('error', 'Document Type updated failed.');
}
});
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'kode' => 'required|string|max:2|min:2|unique:jobs,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('jobs.index')->with('error', 'Job updated failed.');
}
});
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateSpecialCodeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'kode' => 'required|string|max:2|min:2|unique:special_codes,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('special-code.index')->with('error', 'Special Code updated failed.');
}
});
}
}

View File

@ -1,48 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateSubDirectoratRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'kode' => 'required|string|max:2|min:2|unique:sub_directorats,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('sub-directorat.index')->with('error', 'Sub Directorat updated failed.');
}
});
}
}

View File

@ -1,50 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateSubJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'job_id' => 'required|exists:jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_jobs,kode,'.$this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash( $value[0]);
}
return redirect()->route('jobs.index')->with('error', 'Sub Job updated failed.');
}
});
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
class UpdateSubSubJobRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, Rule|array|string>
*/
public function rules(): array
{
return [
'directorat_id' => 'required|exists:directorats,id',
'sub_directorat_id' => 'required|exists:sub_directorats,id',
'job_id' => 'required|exists:jobs,id',
'sub_job_id' => 'required|exists:sub_jobs,id',
'kode' => 'required|string|max:2|min:2|unique:sub_sub_jobs,kode,' . $this->id,
'name' => 'required|string|max:50'
];
}
/**
* Configure the validator instance.
*/
public function withValidator(Validator $validator): void
{
$validator->after(function (Validator $validator) {
if ($validator->errors()->any()) {
$error = json_decode($validator->errors()->toJson(), true);
foreach ($error as $key => $value) {
flash($value[0]);
}
return redirect()->route('jobs.index')->with('error', 'Sub Sub Job updated failed.');
}
});
}
}

View File

@ -1,31 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wildside\Userstamps\Userstamps;
class Directorat extends Model
{
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
protected $fillable = [
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
public function subDirectorat()
{
return $this->hasMany(SubDirectorat::class);
}
}

View File

@ -1,69 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wildside\Userstamps\Userstamps;
class Document extends Model
{
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
protected $fillable = [
'directorat_id',
'sub_directorat_id',
'job_id',
'sub_job_id',
'sub_sub_job_id',
'special_code_id',
'no_urut',
'kode',
'sequence',
'jenis_dokumen'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
public function directorat()
{
return $this->belongsTo(Directorat::class);
}
public function sub_directorat()
{
return $this->belongsTo(SubDirectorat::class);
}
public function job()
{
return $this->belongsTo(Job::class);
}
public function sub_job()
{
return $this->belongsTo(SubJob::class);
}
public function sub_sub_job()
{
return $this->belongsTo(SubSubJob::class);
}
public function special_code()
{
return $this->belongsTo(SpecialCode::class);
}
public function document_details()
{
return $this->hasMany(DocumentDetail::class);
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wildside\Userstamps\Userstamps;
class DocumentDetail extends Model
{
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
protected $fillable = [
'document_id',
'document_type_id',
'nama_nasabah',
'no_rekening',
'no_cif',
'group',
'group',
'tanggal_upload',
'tanggal_dokumen',
'nomor_dokumen',
'perihal',
'kode_cabang',
'jumlah_halaman',
'custom_field_1',
'custom_field_2',
'custom_field_3',
'custom_field_4'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wildside\Userstamps\Userstamps;
class DocumentType extends Model
{
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
protected $fillable = [
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
}

View File

@ -1,41 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Job extends Model
{
use LogsActivity, HasFactory, SoftDeletes;
protected $fillable = [
'directorat_id',
'sub_directorat_id',
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('system');
}
public function directorat()
{
return $this->belongsTo(Directorat::class);
}
public function subDirectorat()
{
return $this->belongsTo(SubDirectorat::class);
}
public function subJob()
{
return $this->hasMany(SubJob::class);
}
}

View File

@ -1,23 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Permission\Models\Permission as SpatiePermission;
class Permission extends SpatiePermission
{
use LogsActivity;
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
public function group()
{
return $this->hasOne(PermissionGroup::class);
}
}

View File

@ -1,55 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Permission\Models\Role;
class PermissionGroup extends Model
{
use LogsActivity;
protected $fillable = [
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
public function permission(){
return $this->hasMany(Permission::class);
}
public function roles($group){
$permission = Permission::where('permission_group_id', $group->id)->first();
$data = [];
$roles = Role::all();
foreach($roles as $role){
if($role->hasPermissionTo($permission->name)){
array_push($data,$role);
}
}
return $data;
}
public static function getpermissionsByGroupId($id)
{
$permissions = DB::table('permissions')
->select('name', 'id')
->where('permission_group_id', $id)
->get();
return $permissions;
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wildside\Userstamps\Userstamps;
class SpecialCode extends Model
{
use LogsActivity, HasFactory, SoftDeletes, Userstamps;
protected $fillable = [
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('master data');
}
}

View File

@ -1,41 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class SubDirectorat extends Model
{
use LogsActivity, HasFactory, SoftDeletes;
protected $fillable = [
'directorat_id',
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('system');
}
public function directorat()
{
return $this->belongsTo(Directorat::class);
}
public function subJobs()
{
return $this->hasMany(SubJob::class);
}
public function jobs()
{
return $this->hasManyThrough(Job::class, SubJob::class);
}
}

View File

@ -1,48 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class SubJob extends Model
{
use LogsActivity, HasFactory, SoftDeletes;
protected $fillable = [
'directorat_id',
'sub_directorat_id',
'job_id',
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('system');
}
public function directorat()
{
return $this->belongsTo(Directorat::class);
}
public function subDirectorat()
{
return $this->belongsTo(SubDirectorat::class);
}
public function job()
{
return $this->belongsTo(Job::class);
}
public function subSubJob()
{
return $this->hasMany(SubSubJob::class);
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Models;
use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class SubSubJob extends Model
{
use LogsActivity, HasFactory, SoftDeletes;
protected $fillable = [
'directorat_id',
'sub_directorat_id',
'job_id',
'sub_job_id',
'kode',
'name'
];
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()->logAll()
->useLogName('system');
}
public function directorat()
{
return $this->belongsTo(Directorat::class);
}
public function subDirectorat()
{
return $this->belongsTo(SubDirectorat::class);
}
public function job()
{
return $this->belongsTo(Job::class);
}
public function subJob()
{
return $this->belongsTo(SubJob::class);
}
}

View File

@ -1,49 +0,0 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Spatie\Permission\Traits\HasRoles;
use Wildside\Userstamps\Userstamps;
class User extends Authenticatable
{
use HasApiTokens, HasFactory, Notifiable, Userstamps;
use HasRoles;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
'directorat_id',
'sub_directorat_id',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}

View File

@ -1,28 +1,27 @@
<?php
namespace App\Providers;
namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
class AuthServiceProvider extends ServiceProvider
{
//
/**
* The model to policy mappings for the application.
*
* @var array<class-string, class-string>
*/
protected $policies = [// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
//
}
}
}

View File

@ -2,19 +2,31 @@
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^8.0.2",
"anlutro/l4-settings": "^1.3",
"dompdf/dompdf": "^2.0",
"guzzlehttp/guzzle": "^7.2",
"haruncpi/laravel-id-generator": "^1.1",
"jackiedo/log-reader": "2.*",
"joshbrw/laravel-module-installer": "^2.0",
"laracasts/flash": "^3.2",
"laravel/framework": "^10.0",
"laravel/sanctum": "^3.0",
"laravel/octane": "^1.5",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.7",
"laravelcollective/html": "^6.4",
"maatwebsite/excel": "^3.1",
"nwidart/laravel-modules": "^10.0",
"putrakuningan/cetaklabel-module": "dev-master",
"putrakuningan/logs-module": "^1.0",
"putrakuningan/usermanager-module": "dev-master",
"simplesoftwareio/simple-qrcode": "^4.2",
"spatie/laravel-activitylog": "^4.7",
"spatie/laravel-permission": "^5.10",
"wildside/userstamps": "^2.3",
@ -40,7 +52,8 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
"Tests\\": "tests/",
"Modules\\": "Modules/"
}
},
"scripts": {
@ -68,9 +81,27 @@
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"joshbrw/laravel-module-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
"prefer-stable": true,
"repositories": [
{
"name": "putrakuningan/logs-module",
"type": "vcs",
"url": "https://git.putrakuningan.com/putrakuningan/Logs"
},
{
"name": "putrakuningan/cetaklabel-module",
"type": "vcs",
"url": "https://git.putrakuningan.com/putrakuningan/Cetaklabel"
},
{
"name": "putrakuningan/usermanager-module",
"type": "vcs",
"url": "https://git.putrakuningan.com/putrakuningan/Usermanager"
}
]
}

9653
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
<?php
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Facades\Facade;
return [
return [
/*
|--------------------------------------------------------------------------
@ -82,7 +82,7 @@ return [
|
*/
'locale' => 'en',
'locale' => 'id',
/*
|--------------------------------------------------------------------------
@ -156,49 +156,49 @@ return [
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\HelperServiceProvider::class,
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
/*
* Application Service Providers...
*/
App\Providers\HelperServiceProvider::class,
App\Providers\AppServiceProvider::class,
\App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Yajra\DataTables\DataTablesServiceProvider::class,
Jackiedo\LogReader\LogReaderServiceProvider::class,
Yajra\DataTables\DataTablesServiceProvider::class,
Jackiedo\LogReader\LogReaderServiceProvider::class,
Spatie\Permission\PermissionServiceProvider::class,
Spatie\Permission\PermissionServiceProvider::class,
],

View File

@ -61,8 +61,8 @@ return [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
'driver' => 'eloquent',
'model' => \Modules\Usermanager\Entities\User::class,
],
// 'users' => [

View File

@ -56,7 +56,7 @@ return [
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'strict' => false,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),

277
config/modules.php Normal file
View File

@ -0,0 +1,277 @@
<?php
use Nwidart\Modules\Activators\FileActivator;
use Nwidart\Modules\Commands;
return [
/*
|--------------------------------------------------------------------------
| Module Namespace
|--------------------------------------------------------------------------
|
| Default module namespace.
|
*/
'namespace' => 'Modules',
/*
|--------------------------------------------------------------------------
| Module Stubs
|--------------------------------------------------------------------------
|
| Default module stubs.
|
*/
'stubs' => [
'enabled' => false,
'path' => base_path('vendor/nwidart/laravel-modules/src/Commands/stubs'),
'files' => [
'routes/web' => 'Routes/web.php',
'routes/api' => 'Routes/api.php',
'views/index' => 'Resources/views/index.blade.php',
'views/master' => 'Resources/views/layouts/master.blade.php',
'scaffold/config' => 'Config/config.php',
'composer' => 'composer.json',
'assets/js/app' => 'Resources/assets/js/app.js',
'assets/sass/app' => 'Resources/assets/sass/app.scss',
'vite' => 'vite.config.js',
'package' => 'package.json',
],
'replacements' => [
'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'],
'routes/api' => ['LOWER_NAME'],
'vite' => ['LOWER_NAME'],
'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE', 'PROVIDER_NAMESPACE'],
'views/index' => ['LOWER_NAME'],
'views/master' => ['LOWER_NAME', 'STUDLY_NAME'],
'scaffold/config' => ['STUDLY_NAME'],
'composer' => [
'LOWER_NAME',
'STUDLY_NAME',
'VENDOR',
'AUTHOR_NAME',
'AUTHOR_EMAIL',
'MODULE_NAMESPACE',
'PROVIDER_NAMESPACE',
],
],
'gitkeep' => true,
],
'paths' => [
/*
|--------------------------------------------------------------------------
| Modules path
|--------------------------------------------------------------------------
|
| This path used for save the generated module. This path also will be added
| automatically to list of scanned folders.
|
*/
'modules' => base_path('Modules'),
/*
|--------------------------------------------------------------------------
| Modules assets path
|--------------------------------------------------------------------------
|
| Here you may update the modules assets path.
|
*/
'assets' => public_path('modules'),
/*
|--------------------------------------------------------------------------
| The migrations path
|--------------------------------------------------------------------------
|
| Where you run 'module:publish-migration' command, where do you publish the
| the migration files?
|
*/
'migration' => base_path('database/migrations'),
/*
|--------------------------------------------------------------------------
| Generator path
|--------------------------------------------------------------------------
| Customise the paths where the folders will be generated.
| Set the generate key to false to not generate that folder
*/
'generator' => [
'config' => ['path' => 'Config', 'generate' => true],
'command' => ['path' => 'Console', 'generate' => true],
'migration' => ['path' => 'Database/Migrations', 'generate' => true],
'seeder' => ['path' => 'Database/Seeders', 'generate' => true],
'factory' => ['path' => 'Database/factories', 'generate' => true],
'model' => ['path' => 'Entities', 'generate' => true],
'routes' => ['path' => 'Routes', 'generate' => true],
'controller' => ['path' => 'Http/Controllers', 'generate' => true],
'filter' => ['path' => 'Http/Middleware', 'generate' => true],
'request' => ['path' => 'Http/Requests', 'generate' => true],
'provider' => ['path' => 'Providers', 'generate' => true],
'assets' => ['path' => 'Resources/assets', 'generate' => true],
'lang' => ['path' => 'Resources/lang', 'generate' => true],
'views' => ['path' => 'Resources/views', 'generate' => true],
'test' => ['path' => 'Tests/Unit', 'generate' => true],
'test-feature' => ['path' => 'Tests/Feature', 'generate' => true],
'repository' => ['path' => 'Repositories', 'generate' => false],
'event' => ['path' => 'Events', 'generate' => false],
'listener' => ['path' => 'Listeners', 'generate' => false],
'policies' => ['path' => 'Policies', 'generate' => false],
'rules' => ['path' => 'Rules', 'generate' => false],
'jobs' => ['path' => 'Jobs', 'generate' => false],
'emails' => ['path' => 'Emails', 'generate' => false],
'notifications' => ['path' => 'Notifications', 'generate' => false],
'resource' => ['path' => 'Transformers', 'generate' => false],
'component-view' => ['path' => 'Resources/views/components', 'generate' => false],
'component-class' => ['path' => 'View/Components', 'generate' => false],
],
],
/*
|--------------------------------------------------------------------------
| Package commands
|--------------------------------------------------------------------------
|
| Here you can define which commands will be visible and used in your
| application. If for example you don't use some of the commands provided
| you can simply comment them out.
|
*/
'commands' => [
Commands\CommandMakeCommand::class,
Commands\ComponentClassMakeCommand::class,
Commands\ComponentViewMakeCommand::class,
Commands\ControllerMakeCommand::class,
Commands\DisableCommand::class,
Commands\DumpCommand::class,
Commands\EnableCommand::class,
Commands\EventMakeCommand::class,
Commands\JobMakeCommand::class,
Commands\ListenerMakeCommand::class,
Commands\MailMakeCommand::class,
Commands\MiddlewareMakeCommand::class,
Commands\NotificationMakeCommand::class,
Commands\ProviderMakeCommand::class,
Commands\RouteProviderMakeCommand::class,
Commands\InstallCommand::class,
Commands\ListCommand::class,
Commands\ModuleDeleteCommand::class,
Commands\ModuleMakeCommand::class,
Commands\FactoryMakeCommand::class,
Commands\PolicyMakeCommand::class,
Commands\RequestMakeCommand::class,
Commands\RuleMakeCommand::class,
Commands\MigrateCommand::class,
Commands\MigrateFreshCommand::class,
Commands\MigrateRefreshCommand::class,
Commands\MigrateResetCommand::class,
Commands\MigrateRollbackCommand::class,
Commands\MigrateStatusCommand::class,
Commands\MigrationMakeCommand::class,
Commands\ModelMakeCommand::class,
Commands\PublishCommand::class,
Commands\PublishConfigurationCommand::class,
Commands\PublishMigrationCommand::class,
Commands\PublishTranslationCommand::class,
Commands\SeedCommand::class,
Commands\SeedMakeCommand::class,
Commands\SetupCommand::class,
Commands\UnUseCommand::class,
Commands\UpdateCommand::class,
Commands\UseCommand::class,
Commands\ResourceMakeCommand::class,
Commands\TestMakeCommand::class,
Commands\LaravelModulesV6Migrator::class,
],
/*
|--------------------------------------------------------------------------
| Scan Path
|--------------------------------------------------------------------------
|
| Here you define which folder will be scanned. By default will scan vendor
| directory. This is useful if you host the package in packagist website.
|
*/
'scan' => [
'enabled' => false,
'paths' => [
base_path('vendor/*/*'),
],
],
/*
|--------------------------------------------------------------------------
| Composer File Template
|--------------------------------------------------------------------------
|
| Here is the config for composer.json file, generated by this package
|
*/
'composer' => [
'vendor' => 'putrakuningan',
'author' => [
'name' => 'Daeng Deni Mardaeni',
'email' => 'ddeni05@gmail.com',
],
'composer-output' => false,
],
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| Here is the config for setting up caching feature.
|
*/
'cache' => [
'enabled' => false,
'driver' => 'file',
'key' => 'laravel-modules',
'lifetime' => 60,
],
/*
|--------------------------------------------------------------------------
| Choose what laravel-modules will register as custom namespaces.
| Setting one to false will require you to register that part
| in your own Service Provider class.
|--------------------------------------------------------------------------
*/
'register' => [
'translations' => true,
/**
* load files on boot or register method
*
* Note: boot not compatible with asgardcms
*
* @example boot|register
*/
'files' => 'register',
],
/*
|--------------------------------------------------------------------------
| Activators
|--------------------------------------------------------------------------
|
| You can define new types of activators here, file, database etc. The only
| required parameter is 'class'.
| The file activator will store the activation status in storage/installed_modules
*/
'activators' => [
'file' => [
'class' => FileActivator::class,
'statuses-file' => base_path('modules_statuses.json'),
'cache-key' => 'activator.installed',
'cache-lifetime' => 604800,
],
],
'activator' => 'file',
];

228
config/octane.php Normal file
View File

@ -0,0 +1,228 @@
<?php
use Laravel\Octane\Contracts\OperationTerminated;
use Laravel\Octane\Events\RequestHandled;
use Laravel\Octane\Events\RequestReceived;
use Laravel\Octane\Events\RequestTerminated;
use Laravel\Octane\Events\TaskReceived;
use Laravel\Octane\Events\TaskTerminated;
use Laravel\Octane\Events\TickReceived;
use Laravel\Octane\Events\TickTerminated;
use Laravel\Octane\Events\WorkerErrorOccurred;
use Laravel\Octane\Events\WorkerStarting;
use Laravel\Octane\Events\WorkerStopping;
use Laravel\Octane\Listeners\CollectGarbage;
use Laravel\Octane\Listeners\DisconnectFromDatabases;
use Laravel\Octane\Listeners\EnsureUploadedFilesAreValid;
use Laravel\Octane\Listeners\EnsureUploadedFilesCanBeMoved;
use Laravel\Octane\Listeners\FlushTemporaryContainerInstances;
use Laravel\Octane\Listeners\FlushUploadedFiles;
use Laravel\Octane\Listeners\ReportException;
use Laravel\Octane\Listeners\StopWorkerIfNecessary;
use Laravel\Octane\Octane;
return [
/*
|--------------------------------------------------------------------------
| Octane Server
|--------------------------------------------------------------------------
|
| This value determines the default "server" that will be used by Octane
| when starting, restarting, or stopping your server via the CLI. You
| are free to change this to the supported server of your choosing.
|
| Supported: "roadrunner", "swoole"
|
*/
'server' => env('OCTANE_SERVER', 'roadrunner'),
/*
|--------------------------------------------------------------------------
| Force HTTPS
|--------------------------------------------------------------------------
|
| When this configuration value is set to "true", Octane will inform the
| framework that all absolute links must be generated using the HTTPS
| protocol. Otherwise your links may be generated using plain HTTP.
|
*/
'https' => env('OCTANE_HTTPS', false),
/*
|--------------------------------------------------------------------------
| Octane Listeners
|--------------------------------------------------------------------------
|
| All of the event listeners for Octane's events are defined below. These
| listeners are responsible for resetting your application's state for
| the next request. You may even add your own listeners to the list.
|
*/
'listeners' => [
WorkerStarting::class => [
EnsureUploadedFilesAreValid::class,
EnsureUploadedFilesCanBeMoved::class,
],
RequestReceived::class => [
...Octane::prepareApplicationForNextOperation(),
...Octane::prepareApplicationForNextRequest(),
//
],
RequestHandled::class => [
//
],
RequestTerminated::class => [
// FlushUploadedFiles::class,
],
TaskReceived::class => [
...Octane::prepareApplicationForNextOperation(),
//
],
TaskTerminated::class => [
//
],
TickReceived::class => [
...Octane::prepareApplicationForNextOperation(),
//
],
TickTerminated::class => [
//
],
OperationTerminated::class => [
FlushTemporaryContainerInstances::class,
// DisconnectFromDatabases::class,
// CollectGarbage::class,
],
WorkerErrorOccurred::class => [
ReportException::class,
StopWorkerIfNecessary::class,
],
WorkerStopping::class => [
//
],
],
/*
|--------------------------------------------------------------------------
| Warm / Flush Bindings
|--------------------------------------------------------------------------
|
| The bindings listed below will either be pre-warmed when a worker boots
| or they will be flushed before every new request. Flushing a binding
| will force the container to resolve that binding again when asked.
|
*/
'warm' => [
...Octane::defaultServicesToWarm(),
],
'flush' => [
//
],
/*
|--------------------------------------------------------------------------
| Octane Cache Table
|--------------------------------------------------------------------------
|
| While using Swoole, you may leverage the Octane cache, which is powered
| by a Swoole table. You may set the maximum number of rows as well as
| the number of bytes per row using the configuration options below.
|
*/
'cache' => [
'rows' => 1000,
'bytes' => 10000,
],
/*
|--------------------------------------------------------------------------
| Octane Swoole Tables
|--------------------------------------------------------------------------
|
| While using Swoole, you may define additional tables as required by the
| application. These tables can be used to store data that needs to be
| quickly accessed by other workers on the particular Swoole server.
|
*/
'tables' => [
'example:1000' => [
'name' => 'string:1000',
'votes' => 'int',
],
],
/*
|--------------------------------------------------------------------------
| File Watching
|--------------------------------------------------------------------------
|
| The following list of files and directories will be watched when using
| the --watch option offered by Octane. If any of the directories and
| files are changed, Octane will automatically reload your workers.
|
*/
'watch' => [
'app',
'bootstrap',
'config',
'database',
'public/**/*.php',
'resources/**/*.php',
'routes',
'composer.lock',
'.env',
],
/*
|--------------------------------------------------------------------------
| Garbage Collection Threshold
|--------------------------------------------------------------------------
|
| When executing long-lived PHP scripts such as Octane, memory can build
| up before being cleared by PHP. You can force Octane to run garbage
| collection if your application consumes this amount of megabytes.
|
*/
'garbage' => 50,
/*
|--------------------------------------------------------------------------
| Maximum Execution Time
|--------------------------------------------------------------------------
|
| The following setting configures the maximum execution time for requests
| being handled by Octane. You may set this value to 0 to indicate that
| there isn't a specific time limit on Octane request execution time.
|
*/
'max_execution_time' => 30,
'swoole' => [
'options' => [
'log_file' => storage_path('logs/swoole_http.log'),
'package_max_length' => 10 * 1024 * 1024,
],
],
];

View File

@ -1,237 +1,310 @@
<?php
return [
use App\Core\Bootstrap\BootstrapAuth;
use App\Core\Bootstrap\BootstrapDefault;
use App\Core\Bootstrap\BootstrapSystem;
'KT_THEME_BOOTSTRAP' => [
'default' => \App\Core\Bootstrap\BootstrapDefault::class,
'auth' => \App\Core\Bootstrap\BootstrapAuth::class,
'system' => \App\Core\Bootstrap\BootstrapSystem::class,
],
return [
'KT_THEME' => 'metronic',
'KT_THEME_BOOTSTRAP' => [
'default' => BootstrapDefault::class,
'auth' => BootstrapAuth::class,
'system' => BootstrapSystem::class,
],
# Theme layout templates directory
'KT_THEME' => 'metronic',
'KT_THEME_LAYOUT_DIR' => 'layout',
# Theme layout templates directory
'KT_THEME_LAYOUT_DIR' => 'layout',
# Theme Mode
# Value: light | dark | system
# Theme Mode
# Value: light | dark | system
'KT_THEME_MODE_DEFAULT' => 'light',
'KT_THEME_MODE_SWITCH_ENABLED' => true,
'KT_THEME_MODE_DEFAULT' => 'light',
'KT_THEME_MODE_SWITCH_ENABLED' => true,
# Theme Direction
# Value: ltr | rtl
# Theme Direction
# Value: ltr | rtl
'KT_THEME_DIRECTION' => 'ltr',
'KT_THEME_DIRECTION' => 'ltr',
# Keenicons
# Value: duotone | outline | bold
# Keenicons
# Value: duotone | outline | bold
'KT_THEME_ICONS' => 'duotone',
'KT_THEME_ICONS' => 'duotone',
# Theme Assets
# Theme Assets
'KT_THEME_ASSETS' => [
'favicon' => 'assets/media/logos/favicon.ico',
'fonts' => [
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700',
],
'global' => [
'css' => [
'assets/plugins/global/plugins.bundle.css',
'assets/css/style.bundle.css',
'KT_THEME_ASSETS' => [
'favicon' => 'assets/media/logos/favicon-agi .ico',
'fonts' => [
'https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700',
],
'js' => [
'assets/plugins/global/plugins.bundle.js',
'assets/js/scripts.bundle.js',
'assets/js/widgets.bundle.js',
'global' => [
'css' => [
'assets/plugins/global/plugins.bundle.css',
'assets/css/style.bundle.css',
],
'js' => [
'assets/plugins/global/plugins.bundle.js',
'assets/js/scripts.bundle.js',
'assets/js/widgets.bundle.js',
],
],
],
],
# Theme Vendors
# Theme Vendors
'KT_THEME_VENDORS' => [
'datatables' => [
'css' => [
'assets/plugins/custom/datatables/datatables.bundle.css',
'KT_THEME_VENDORS' => [
'datatables' => [
'css' => [
'assets/plugins/custom/datatables/datatables.bundle.css',
],
'js' => [
'assets/plugins/custom/datatables/datatables.bundle.js',
],
],
'js' => [
'assets/plugins/custom/datatables/datatables.bundle.js',
'formrepeater' => [
'js' => [
'assets/plugins/custom/formrepeater/formrepeater.bundle.js',
],
],
'fullcalendar' => [
'css' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.css',
],
'js' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.js',
],
],
'flotcharts' => [
'js' => [
'assets/plugins/custom/flotcharts/flotcharts.bundle.js',
],
],
'google-jsapi' => [
'js' => [
'//www.google.com/jsapi',
],
],
'tinymce' => [
'js' => [
'assets/plugins/custom/tinymce/tinymce.bundle.js',
],
],
'ckeditor-classic' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js',
],
],
'ckeditor-inline' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-inline.bundle.js',
],
],
'ckeditor-balloon' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon.bundle.js',
],
],
'ckeditor-balloon-block' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon-block.bundle.js',
],
],
'ckeditor-document' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-document.bundle.js',
],
],
'draggable' => [
'js' => [
'assets/plugins/custom/draggable/draggable.bundle.js',
],
],
'fslightbox' => [
'js' => [
'assets/plugins/custom/fslightbox/fslightbox.bundle.js',
],
],
'jkanban' => [
'css' => [
'assets/plugins/custom/jkanban/jkanban.bundle.css',
],
'js' => [
'assets/plugins/custom/jkanban/jkanban.bundle.js',
],
],
'typedjs' => [
'js' => [
'assets/plugins/custom/typedjs/typedjs.bundle.js',
],
],
'cookiealert' => [
'css' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.css',
],
'js' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.js',
],
],
'cropper' => [
'css' => [
'assets/plugins/custom/cropper/cropper.bundle.css',
],
'js' => [
'assets/plugins/custom/cropper/cropper.bundle.js',
],
],
'vis-timeline' => [
'css' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.css',
],
'js' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.js',
],
],
'jstree' => [
'css' => [
'assets/plugins/custom/jstree/jstree.bundle.css',
],
'js' => [
'assets/plugins/custom/jstree/jstree.bundle.js',
],
],
'prismjs' => [
'css' => [
'assets/plugins/custom/prismjs/prismjs.bundle.css',
],
'js' => [
'assets/plugins/custom/prismjs/prismjs.bundle.js',
],
],
'leaflet' => [
'css' => [
'assets/plugins/custom/leaflet/leaflet.bundle.css',
],
'js' => [
'assets/plugins/custom/leaflet/leaflet.bundle.js',
],
],
'amcharts' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/percent.js',
'https://cdn.amcharts.com/lib/5/radar.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-maps' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/map.js',
'https://cdn.amcharts.com/lib/5/geodata/worldLow.js',
'https://cdn.amcharts.com/lib/5/geodata/continentsLow.js',
'https://cdn.amcharts.com/lib/5/geodata/usaLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZonesLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZoneAreasLow.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-stock' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'bootstrap-select' => [
'css' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.css',
],
'js' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.js',
],
],
'chained-select' => [
'js' => [
'assets/plugins/custom/jquery-chained/jquery.chained.js',
'assets/plugins/custom/jquery-chained/jquery.chained.remote.js',
],
],
],
'formrepeater' => [
'js' => [
'assets/plugins/custom/formrepeater/formrepeater.bundle.js',
],
],
'fullcalendar' => [
'css' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.css',
],
'js' => [
'assets/plugins/custom/fullcalendar/fullcalendar.bundle.js',
],
],
'flotcharts' => [
'js' => [
'assets/plugins/custom/flotcharts/flotcharts.bundle.js',
],
],
'google-jsapi' => [
'js' => [
'//www.google.com/jsapi',
],
],
'tinymce' => [
'js' => [
'assets/plugins/custom/tinymce/tinymce.bundle.js',
],
],
'ckeditor-classic' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-classic.bundle.js',
],
],
'ckeditor-inline' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-inline.bundle.js',
],
],
'ckeditor-balloon' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon.bundle.js',
],
],
'ckeditor-balloon-block' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-balloon-block.bundle.js',
],
],
'ckeditor-document' => [
'js' => [
'assets/plugins/custom/ckeditor/ckeditor-document.bundle.js',
],
],
'draggable' => [
'js' => [
'assets/plugins/custom/draggable/draggable.bundle.js',
],
],
'fslightbox' => [
'js' => [
'assets/plugins/custom/fslightbox/fslightbox.bundle.js',
],
],
'jkanban' => [
'css' => [
'assets/plugins/custom/jkanban/jkanban.bundle.css',
],
'js' => [
'assets/plugins/custom/jkanban/jkanban.bundle.js',
],
],
'typedjs' => [
'js' => [
'assets/plugins/custom/typedjs/typedjs.bundle.js',
],
],
'cookiealert' => [
'css' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.css',
],
'js' => [
'assets/plugins/custom/cookiealert/cookiealert.bundle.js',
],
],
'cropper' => [
'css' => [
'assets/plugins/custom/cropper/cropper.bundle.css',
],
'js' => [
'assets/plugins/custom/cropper/cropper.bundle.js',
],
],
'vis-timeline' => [
'css' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.css',
],
'js' => [
'assets/plugins/custom/vis-timeline/vis-timeline.bundle.js',
],
],
'jstree' => [
'css' => [
'assets/plugins/custom/jstree/jstree.bundle.css',
],
'js' => [
'assets/plugins/custom/jstree/jstree.bundle.js',
],
],
'prismjs' => [
'css' => [
'assets/plugins/custom/prismjs/prismjs.bundle.css',
],
'js' => [
'assets/plugins/custom/prismjs/prismjs.bundle.js',
],
],
'leaflet' => [
'css' => [
'assets/plugins/custom/leaflet/leaflet.bundle.css',
],
'js' => [
'assets/plugins/custom/leaflet/leaflet.bundle.js',
],
],
'amcharts' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/percent.js',
'https://cdn.amcharts.com/lib/5/radar.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-maps' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/map.js',
'https://cdn.amcharts.com/lib/5/geodata/worldLow.js',
'https://cdn.amcharts.com/lib/5/geodata/continentsLow.js',
'https://cdn.amcharts.com/lib/5/geodata/usaLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZonesLow.js',
'https://cdn.amcharts.com/lib/5/geodata/worldTimeZoneAreasLow.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'amcharts-stock' => [
'js' => [
'https://cdn.amcharts.com/lib/5/index.js',
'https://cdn.amcharts.com/lib/5/xy.js',
'https://cdn.amcharts.com/lib/5/themes/Animated.js',
],
],
'bootstrap-select' => [
'css' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.css',
],
'js' => [
'assets/plugins/custom/bootstrap-select/bootstrap-select.bundle.js',
],
],
'chained-select' => [
'js' => [
'assets/plugins/custom/jquery-chained/jquery.chained.js',
'assets/plugins/custom/jquery-chained/jquery.chained.remote.js',
],
],
],
/*
|--------------------------------------------------------------------------
| Default Settings Store
|--------------------------------------------------------------------------
|
| This option controls the default settings store that gets used while
| using this settings library.
|
| Supported: "json", "database"
|
*/
'store' => 'database',
];
/*
|--------------------------------------------------------------------------
| JSON Store
|--------------------------------------------------------------------------
|
| If the store is set to "json", settings are stored in the defined
| file path in JSON format. Use full path to file.
|
*/
'path' => storage_path() . '/settings.json',
/*
|--------------------------------------------------------------------------
| Database Store
|--------------------------------------------------------------------------
|
| The settings are stored in the defined file path in JSON format.
| Use full path to JSON file.
|
*/
// If set to null, the default connection will be used.
'connection' => null,
// Name of the table used.
'table' => 'settings',
// If you want to use custom column names in database store you could
// set them in this configuration
'keyColumn' => 'key',
'valueColumn' => 'value',
/*
|--------------------------------------------------------------------------
| Cache settings
|--------------------------------------------------------------------------
|
| If you want all setting calls to go through Laravel's cache system.
|
*/
'enableCache' => false,
// Whether to reset the cache when changing a setting.
'forgetCacheByWrite' => true,
// TTL in seconds.
'cacheTtl' => 15,
/*
|--------------------------------------------------------------------------
| Default Settings
|--------------------------------------------------------------------------
|
| Define all default settings that will be used before any settings are set,
| this avoids all settings being set to false to begin with and avoids
| hardcoding the same defaults in all 'Settings::get()' calls
|
*/
'defaults' => [
'foo' => 'bar',
]
];

View File

@ -1,8 +0,0 @@
begin
sys.dbms_job.submit(job => :job,
what => 'wof_admin.Proses_Hitung_Bunga(2);',
next_date => to_date('11-04-2023', 'dd-mm-yyyy'),
interval => 'trunc(sysdate)+1');
commit;
end;
/

View File

@ -1,34 +0,0 @@
INSERT INTO PRM_REKENING (NOMOR_REKENING, KD_DEBITUR, KD_CABANG, KD_PRODUK, KET_PRODUK, KD_MATA_UANG, TGL_BUKA,
LIMIT_REF, STATUS_REKENING, STATUS_DATA, FLAG_OTO, TGL_UPDATE)
SELECT ACCOUNT_NUMBER,
CASE
WHEN CUSTOMER_CODE IS NULL THEN
0
ELSE CUSTOMER_CODE
END AS KD_DEBITUR,
BRANCH_CODE,
a.PRODUCT_CODE,
PRODUCT_DESCRIPTION,
CURRENCY_CODE,
OPENING_DATE,
CASE
WHEN MINIMUM_BALANCE IS NULL THEN
0
ELSE minimum_balance
END AS LIMIT_REF,
CASE
WHEN INACTIVE_FLAG IS NULL THEN
'N'
ELSE 'Y'
END AS STATUS_REKENING,
CASE
WHEN INACTIVE_FLAG IS NULL THEN
'N'
ELSE 'Y'
END AS STATUS_DATA,
'1' AS FLAG_OTO,
CURRENT_dATE AS TGL_UPDATE
FROM T_aCCOUNT @t24dwh_96 a
INNER JOIN T_PRODUCT @T24DWH_96 b
ON a.product_code = b.product_code;

View File

@ -1,40 +0,0 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition()
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the model's email address should be unverified.
*
* @return static
*/
public function unverified()
{
return $this->state(fn (array $attributes) => [
'email_verified_at' => null,
]);
}
}

View File

@ -1,43 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->foreignIdFor('App\Models\Directorat', 'directorat_id')->nullable();
$table->foreignIdFor('App\Models\SubDirectorat', 'sub_directorat_id')->nullable();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
};

View File

@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
};

View File

@ -1,41 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
};

View File

@ -1,42 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->id();
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('personal_access_tokens');
}
};

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('directorats', function (Blueprint $table) {
$table->id();
$table->string('kode',2);
$table->string('name',50);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('directorats');
}
};

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sub_directorats', function (Blueprint $table) {
$table->id();
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
$table->string('kode',2);
$table->string('name',50);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_directorats');
}
};

View File

@ -1,36 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('jobs', function (Blueprint $table) {
$table->id();
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
$table->string('kode',2);
$table->string('name',50);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
}
};

View File

@ -1,37 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sub_jobs', function (Blueprint $table) {
$table->id();
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
$table->foreignId('job_id')->constrained('jobs')->onDelete('cascade');
$table->string('kode',2);
$table->string('name',50);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_jobs');
}
};

View File

@ -1,31 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->create(config('activitylog.table_name'), function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('log_name')->nullable();
$table->text('description');
$table->nullableMorphs('subject', 'subject');
$table->nullableMorphs('causer', 'causer');
$table->json('properties')->nullable();
$table->timestamps();
$table->index('log_name');
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->dropIfExists(config('activitylog.table_name'));
}
}

View File

@ -1,22 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddEventColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->string('event')->nullable()->after('subject_type');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('event');
});
}
}

View File

@ -1,22 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddBatchUuidColumnToActivityLogTable extends Migration
{
public function up()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->uuid('batch_uuid')->nullable()->after('properties');
});
}
public function down()
{
Schema::connection(config('activitylog.database_connection'))->table(config('activitylog.table_name'), function (Blueprint $table) {
$table->dropColumn('batch_uuid');
});
}
}

View File

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('sub_sub_jobs', function (Blueprint $table) {
$table->id();
$table->foreignId('sub_job_id')->constrained('sub_jobs')->onDelete('cascade');
$table->foreignId('job_id')->constrained('jobs')->onDelete('cascade');
$table->foreignId('sub_directorat_id')->constrained('sub_directorats')->onDelete('cascade');
$table->foreignId('directorat_id')->constrained('directorats')->onDelete('cascade');
$table->string('kode');
$table->string('name');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('sub_sub_jobs');
}
};

View File

@ -1,141 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Spatie\Permission\PermissionRegistrar;
class CreatePermissionTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$tableNames = config('permission.table_names');
$columnNames = config('permission.column_names');
$teams = config('permission.teams');
if (empty($tableNames)) {
throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.');
}
if ($teams && empty($columnNames['team_foreign_key'] ?? null)) {
throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.');
}
Schema::create($tableNames['permissions'], function (Blueprint $table) {
$table->bigIncrements('id'); // permission id
$table->string('name'); // For MySQL 8.0 use string('name', 125);
$table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
$table->timestamps();
$table->unique(['name', 'guard_name']);
});
Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) {
$table->bigIncrements('id'); // role id
if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing
$table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable();
$table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index');
}
$table->string('name'); // For MySQL 8.0 use string('name', 125);
$table->string('guard_name'); // For MySQL 8.0 use string('guard_name', 125);
$table->timestamps();
if ($teams || config('permission.testing')) {
$table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']);
} else {
$table->unique(['name', 'guard_name']);
}
});
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
$table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index');
$table->foreign(PermissionRegistrar::$pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
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'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
} else {
$table->primary([PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type'],
'model_has_permissions_permission_model_type_primary');
}
});
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) {
$table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
$table->string('model_type');
$table->unsignedBigInteger($columnNames['model_morph_key']);
$table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index');
$table->foreign(PermissionRegistrar::$pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
if ($teams) {
$table->unsignedBigInteger($columnNames['team_foreign_key']);
$table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index');
$table->primary([$columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
} else {
$table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'],
'model_has_roles_role_model_type_primary');
}
});
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
$table->unsignedBigInteger(PermissionRegistrar::$pivotPermission);
$table->unsignedBigInteger(PermissionRegistrar::$pivotRole);
$table->foreign(PermissionRegistrar::$pivotPermission)
->references('id') // permission id
->on($tableNames['permissions'])
->onDelete('cascade');
$table->foreign(PermissionRegistrar::$pivotRole)
->references('id') // role id
->on($tableNames['roles'])
->onDelete('cascade');
$table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary');
});
app('cache')
->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null)
->forget(config('permission.cache.key'));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$tableNames = config('permission.table_names');
if (empty($tableNames)) {
throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.');
}
Schema::drop($tableNames['role_has_permissions']);
Schema::drop($tableNames['model_has_roles']);
Schema::drop($tableNames['model_has_permissions']);
Schema::drop($tableNames['roles']);
Schema::drop($tableNames['permissions']);
}
}

View File

@ -1,38 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('permission_groups', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('permission_groups');
}
};

View File

@ -1,28 +0,0 @@
<?php
use App\Models\PermissionGroup;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('permissions', function($table) {
$table->foreignIdFor(PermissionGroup::class);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropForeignKey('permission_group_id');
Schema::dropColumn('permission_group_id');
}
};

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('document_types', function (Blueprint $table) {
$table->id();
$table->string('kode', 2);
$table->string('name');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('special_codes');
}
};

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('special_codes', function (Blueprint $table) {
$table->id();
$table->string('kode', 2);
$table->string('name');
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('special_codes');
}
};

Some files were not shown because too many files have changed in this diff Show More