First Commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
@@ -0,0 +1,76 @@
|
||||
APP_NAME=E-SAMASA
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:JWoCrp63f8mipgiOWhwpIG+YVpw1Lunn4RZf0mcBWNg=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
_DB_HOST=localhost
|
||||
_DB_PORT=3306
|
||||
_DB_DATABASE=skpp
|
||||
_DB_USERNAME=root
|
||||
_DB_PASSWORD=root
|
||||
DB_HOST=10.15.34.148
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=e_samasa
|
||||
DB_USERNAME=aplikasi
|
||||
DB_PASSWORD=pusdatin
|
||||
|
||||
ORA_CONNECTION=oracle
|
||||
ORA_HOST=10.15.34.45
|
||||
ORA_PORT=1521
|
||||
ORA_DATABASE=NEWSIPKD
|
||||
ORA_USERNAME=proksi
|
||||
ORA_PASSWORD=123456
|
||||
ORA_SERVICENAME=sipkd.localdomain
|
||||
|
||||
ORA_CONNECTION=oracle2
|
||||
ORA_HOST=10.15.34.159
|
||||
ORA_PORT=1521
|
||||
ORA_DATABASE=BAPEDA_BUDGETING
|
||||
ORA_USERNAME=dev1
|
||||
ORA_PASSWORD=dev123
|
||||
ORA_SERVICENAME=EBUDGETING
|
||||
|
||||
SOA_PEGAWAI=https://soadev.jakarta.go.id/rest/gov/dki/simpeg/ws/skpp
|
||||
SOA_PEGAWAI_USER=sipkddev
|
||||
SOA_PEGAWAI_PASSWORD=sipkddev!!
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DRIVER=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailhog
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS=null
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
@@ -0,0 +1,5 @@
|
||||
* text=auto
|
||||
*.css linguist-vendored
|
||||
*.scss linguist-vendored
|
||||
*.js linguist-vendored
|
||||
CHANGELOG.md export-ignore
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
/node_modules
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.phpunit.result.cache
|
||||
docker-compose.override.yml
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.idea
|
||||
/.vscode
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "public/gentelella"]
|
||||
path = public/gentelella
|
||||
url = https://github.com/ColorlibHQ/gentelella.git
|
||||
@@ -0,0 +1,14 @@
|
||||
php:
|
||||
preset: laravel
|
||||
version: 8
|
||||
disabled:
|
||||
- no_unused_imports
|
||||
finder:
|
||||
not-name:
|
||||
- index.php
|
||||
- server.php
|
||||
js:
|
||||
finder:
|
||||
not-name:
|
||||
- webpack.mix.js
|
||||
css: true
|
||||
@@ -0,0 +1,64 @@
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](https://patreon.com/taylorotwell).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Cubet Techno Labs](https://cubettech.com)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[Many](https://www.many.co.uk)**
|
||||
- **[Webdock, Fast VPS Hosting](https://www.webdock.io/en)**
|
||||
- **[DevSquad](https://devsquad.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
- **[CMS Max](https://www.cmsmax.com/)**
|
||||
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the inputs that are never flashed for validation exceptions.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Models\VwSkppHst;
|
||||
use Maatwebsite\Excel\Concerns\FromQuery;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
use Maatwebsite\Excel\Concerns\WithMapping;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class SkppHstExport implements FromQuery, WithMapping, WithHeadings
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function __construct(int $skppId)
|
||||
{
|
||||
$this->skpp_id = $skppId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function query()
|
||||
{
|
||||
return VwSkppHst::query()->where("tx_skpp_id", $this->skpp_id);
|
||||
}
|
||||
|
||||
public function columnFormats(): array
|
||||
{
|
||||
return [
|
||||
'B' => NumberFormat::FORMAT_TEXT,
|
||||
];
|
||||
}
|
||||
|
||||
public function map($skpp_hst): array
|
||||
{
|
||||
return [
|
||||
$skpp_hst->no_skpp,
|
||||
"'".$skpp_hst->nip,
|
||||
$skpp_hst->nrk,
|
||||
$skpp_hst->nama,
|
||||
$skpp_hst->nama_golongan,
|
||||
$skpp_hst->status_pegawai,
|
||||
$skpp_hst->tugas,
|
||||
$skpp_hst->dinas,
|
||||
$skpp_hst->tgl_akhir,
|
||||
$skpp_hst->nama_hak,
|
||||
$skpp_hst->nama_keputusan,
|
||||
$skpp_hst->no_pen,
|
||||
$skpp_hst->tgl_pen,
|
||||
$skpp_hst->tgl_tmt,
|
||||
$skpp_hst->ga_pok,
|
||||
$skpp_hst->t_issum,
|
||||
$skpp_hst->t_anak,
|
||||
$skpp_hst->t_lain,
|
||||
$skpp_hst->t_jab,
|
||||
$skpp_hst->t_beras,
|
||||
$skpp_hst->tpph,
|
||||
$skpp_hst->bulat,
|
||||
$skpp_hst->p_beras,
|
||||
$skpp_hst->iuran,
|
||||
$skpp_hst->ppph,
|
||||
$skpp_hst->lain_2,
|
||||
$skpp_hst->nama_kantor,
|
||||
$skpp_hst->wilayah_kantor,
|
||||
$skpp_hst->tgl_cetak,
|
||||
$skpp_hst->keterangan,
|
||||
$skpp_hst->nama_kantor1,
|
||||
$skpp_hst->nama_kantor2,
|
||||
$skpp_hst->wilayah,
|
||||
$skpp_hst->revisi_remarks,
|
||||
date("Y-m-d",strtotime($skpp_hst->created_at)),
|
||||
];
|
||||
}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
"No SKPP",
|
||||
"NIP",
|
||||
"NRK",
|
||||
"Nama",
|
||||
"Golongan",
|
||||
"Status Pegawai",
|
||||
"Tugas",
|
||||
"Dinas",
|
||||
"Tgl akhir",
|
||||
"Hak",
|
||||
"Keputusan",
|
||||
"No Keputusan",
|
||||
"Tgl Keputusan",
|
||||
"Tgl TMT",
|
||||
"Gaji Pokok",
|
||||
"Tunjangan Suami Istri",
|
||||
"Tunjangan Anak",
|
||||
"Tunjangan Lain",
|
||||
"Tunjangan Jabatan",
|
||||
"Tunjangan Beras",
|
||||
"Tunjangan PPH",
|
||||
"Pembulatan",
|
||||
"Potongan Beras",
|
||||
"Iuran",
|
||||
"Potongan PPH",
|
||||
"lain - Lain",
|
||||
"Kantor",
|
||||
"Wilayah",
|
||||
"Tgl Cetak",
|
||||
"Pindah Tugas Kantor 1",
|
||||
"Pindah Tugas Kantor 2",
|
||||
"Pindah Tugas Wilayah",
|
||||
"Keterangan",
|
||||
"revisi_remarks",
|
||||
"Tgl Dibuat",
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstGolongan;
|
||||
use Illuminate\Http\Request;
|
||||
use Config;
|
||||
|
||||
class MstGolonganController extends Controller
|
||||
{
|
||||
public function __construct(Request $request){
|
||||
$this->siteTitle = "Data Golongan";
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = MstGolongan::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_golongan.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_golongan.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_golongan' => 'required',
|
||||
'nama_pangkat' => 'required',
|
||||
'golongan_besar' => 'required',
|
||||
'alias' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
MstGolongan::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-golongan.index')
|
||||
->with('success','Post created successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstGolongan $MstGolongan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(MstGolongan $MstGolongan)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_golongan.show',compact('MstGolongan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstGolongan $MstGolongan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(MstGolongan $MstGolongan)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_golongan.edit',compact('MstGolongan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Models\MstGolongan $MstGolongan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, MstGolongan $MstGolongan)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_golongan' => 'required',
|
||||
'nama_pangkat' => 'required',
|
||||
'golongan_besar' => 'required',
|
||||
'alias' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$MstGolongan->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-golongan.index')
|
||||
->with('success','Golongan berhasil diubah!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\MstGolongan $MstGolongan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(MstGolongan $MstGolongan)
|
||||
{
|
||||
$MstGolongan->delete();
|
||||
|
||||
return redirect()->route('mst-golongan.index')
|
||||
->with('success','Golongan berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function golonganList()
|
||||
{
|
||||
$mstGolongan = MstGolongan::select(["id","nama_golongan","nama_pangkat","alias"])->get();
|
||||
return response()->json($mstGolongan);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstHak;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MstHakController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Hak";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = MstHak::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_hak.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_hak.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_hak' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
MstHak::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-hak.index')
|
||||
->with('success','Hak berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstHak $MstHak)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_hak.show',compact('MstHak'));
|
||||
}
|
||||
|
||||
public function edit(MstHak $MstHak)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_hak.edit',compact('MstHak'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstHak $MstHak)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_hak' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$MstHak->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-hak.index')
|
||||
->with('success','Hak berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstHak $MstHak)
|
||||
{
|
||||
$MstHak->delete();
|
||||
|
||||
return redirect()->route('mst-hak.index')
|
||||
->with('success','Hak berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function hakList()
|
||||
{
|
||||
$mstKantor = MstHak::select(["id","nama_hak"])->get();
|
||||
return response()->json($mstKantor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstKantor;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MstKantorController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Kantor";
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = MstKantor::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_kantor.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_kantor.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_kantor' => 'required',
|
||||
'wilayah' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
MstKantor::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-kantor.index')
|
||||
->with('success','Post created successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstKantor $MstKantor
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(MstKantor $MstKantor)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_kantor.show',compact('MstKantor'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstKantor $MstKantor
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(MstKantor $MstKantor)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_kantor.edit',compact('MstKantor'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Models\MstKantor $MstKantor
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, MstKantor $MstKantor)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_kantor' => 'required',
|
||||
'wilayah' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$MstKantor->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-kantor.index')
|
||||
->with('success','Tempat Kerja berhasil diubah!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\MstKantor $MstKantor
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(MstKantor $MstKantor)
|
||||
{
|
||||
$MstKantor->delete();
|
||||
|
||||
return redirect()->route('mst-kantor.index')
|
||||
->with('success','Tempat Kerja berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function kantorList()
|
||||
{
|
||||
$mstKantor = MstKantor::select(["id","nama_kantor","wilayah"])->get();
|
||||
return response()->json($mstKantor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstKeputusan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MstKeputusanController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Keputusan";
|
||||
parent::__construct();
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data = MstKeputusan::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_keputusan.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_keputusan.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_keputusan' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
MstKeputusan::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-keputusan.index')
|
||||
->with('success','Post created successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstKeputusan $mstKeputusan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(MstKeputusan $mstKeputusan)
|
||||
{
|
||||
// var_dump($mstKeputusan); exit;
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_keputusan.show',compact('mstKeputusan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\MstKeputusan $mstKeputusan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(MstKeputusan $mstKeputusan)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_keputusan.edit',compact('mstKeputusan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Models\MstKeputusan $mstKeputusan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, MstKeputusan $mstKeputusan)
|
||||
{
|
||||
$request->validate([
|
||||
'nama_keputusan' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$mstKeputusan->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-keputusan.index')
|
||||
->with('success','Keputusan berhasil diubah!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\MstKeputusan $mstKeputusan
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(MstKeputusan $mstKeputusan)
|
||||
{
|
||||
$mstKeputusan->delete();
|
||||
|
||||
return redirect()->route('mst-keputusan.index')
|
||||
->with('success','Keputusan berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function keputusanList()
|
||||
{
|
||||
$mstKeputusan = MstKeputusan::select(["id","nama_keputusan"])->get();
|
||||
return response()->json($mstKeputusan);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstKpkd;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MstKpkdController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data KPKD";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = MstKpkd::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_kpkd.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_kpkd.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'nama' => 'required',
|
||||
'nip' => 'required',
|
||||
'nrk' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
MstKpkd::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-kpkd.index')
|
||||
->with('success','Data KPKD berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(MstKpkd $mstKpkd)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_kpkd.show',compact('mstKpkd'));
|
||||
}
|
||||
|
||||
public function edit(MstKpkd $mstKpkd)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_kpkd.edit',compact('mstKpkd'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstKpkd $mstKpkd)
|
||||
{
|
||||
$request->validate([
|
||||
'nama' => 'required',
|
||||
'nip' => 'required',
|
||||
'nrk' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$mstKpkd->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-kpkd.index')
|
||||
->with('success','Data KPKD berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstKpkd $mstKpkd)
|
||||
{
|
||||
$mstKpkd->delete();
|
||||
|
||||
return redirect()->route('mst-kpkd.index')
|
||||
->with('success','Data KPKD berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function kpkdList()
|
||||
{
|
||||
$mstKpkd = MstKpkd::where("status_aktif", 1)->select(["id","nama"])->get();
|
||||
return response()->json($mstKpkd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Role;
|
||||
use App\Models\Roless;
|
||||
use App\Models\RoleUser;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class MstPenggunaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Pengguna";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = User::where('role_name', "<>", "superadmin")->latest()->paginate(10);
|
||||
return view('admin.mst_pengguna.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_pengguna.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'nrk' => 'required',
|
||||
'password' => 'required',
|
||||
'opt_role' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll["password"] = \Hash::make($requestAll["password"]);
|
||||
$requestAll["role_name"] = $requestAll["opt_role"];
|
||||
$user=User::create($requestAll);
|
||||
|
||||
$user->roles()->detach();
|
||||
//$user->removeRole($requestAll["opt_role"]);
|
||||
$user->assignRole($requestAll["opt_role"]);
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(User $user)
|
||||
{
|
||||
$user = User::with("roleUser.role")->where("id",$user->id)->first();
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_pengguna.show',compact('user'));
|
||||
}
|
||||
|
||||
public function edit(User $user)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_pengguna.edit',compact('user'));
|
||||
}
|
||||
|
||||
public function update(Request $request, User $user)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
'opt_role' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll["role_name"] = $requestAll["opt_role"];
|
||||
$user->update($requestAll);
|
||||
|
||||
$user->roles()->detach();
|
||||
// $user->removeRole($requestAll["opt_role"]);
|
||||
$user->assignRole($requestAll["opt_role"]);
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(User $user)
|
||||
{
|
||||
$user->delete();
|
||||
|
||||
return redirect()->route('users.index')
|
||||
->with('success','User berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function roleList()
|
||||
{
|
||||
$mstRole = Roless::where("name","<>","superadmin")->select(["name","name"])->get();
|
||||
return response()->json($mstRole);
|
||||
}
|
||||
|
||||
public function changePass()
|
||||
{
|
||||
return view('admin.mst_pengguna.change_password');
|
||||
}
|
||||
|
||||
public function changePassSubmit(Request $request, $userId)
|
||||
{
|
||||
$request->validate([
|
||||
'old_password' => 'required',
|
||||
'new_password' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$cekUser = User::find($userId);
|
||||
if (\Hash::check($requestAll["old_password"], $cekUser->password)){
|
||||
User::where("id",$userId)->update(["password"=>\Hash::make($requestAll["new_password"])]);
|
||||
|
||||
return redirect()->route('home')
|
||||
->with('success','Kata sandi pengguna berhasil diubah!');
|
||||
}else{
|
||||
return redirect()->route('home')
|
||||
->with('error','Kata sandi gagal diubah!, Kata sandi lama salah!');
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\MstTempatKerja;
|
||||
use App\Models\Tropd;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MstTempatKerjaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Tempat Kerja";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = MstTempatKerja::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_tempatkerja.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_tempatkerja.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'skpd_id' => 'required',
|
||||
'tempat_kerja' => 'required',
|
||||
]);
|
||||
|
||||
$skpd = Tropd::where('I_ID', $request->skpd_id)->first();
|
||||
$requestAll = $request->all();
|
||||
$requestAll["skpd_name"] = $skpd->n_opd;
|
||||
|
||||
MstTempatKerja::create($requestAll);
|
||||
|
||||
return redirect()->route('mst-tempat_kerja.index')
|
||||
->with('success','Post created successfully.');
|
||||
}
|
||||
|
||||
public function show(MstTempatKerja $MstTempatKerja)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_tempatkerja.show',compact('MstTempatKerja'));
|
||||
}
|
||||
|
||||
public function edit(MstTempatKerja $MstTempatKerja)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_tempatkerja.edit',compact('MstTempatKerja'));
|
||||
}
|
||||
|
||||
public function update(Request $request, MstTempatKerja $MstTempatKerja)
|
||||
{
|
||||
$request->validate([
|
||||
'skpd_id' => 'required',
|
||||
'tempat_kerja' => 'required',
|
||||
]);
|
||||
|
||||
$skpd = Tropd::where('I_ID', $request->skpd_id)->first();
|
||||
$requestAll = $request->all();
|
||||
$requestAll["skpd_name"] = $skpd->n_opd;
|
||||
|
||||
$MstTempatKerja->update($requestAll);
|
||||
|
||||
return redirect()->route('mst-tempat_kerja.index')
|
||||
->with('success','Tempat Kerja berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(MstTempatKerja $MstTempatKerja)
|
||||
{
|
||||
$MstTempatKerja->delete();
|
||||
|
||||
return redirect()->route('mst-tempat_kerja.index')
|
||||
->with('success','Tempat Kerja berhasil dihapus!');
|
||||
}
|
||||
|
||||
public function tempatKerjaList($idUnit){
|
||||
$tempatKerja = MstTempatKerja::select("tempat_kerja")
|
||||
->distinct()
|
||||
->where("id_unit",$idUnit)
|
||||
->get()->toArray();
|
||||
|
||||
$arrColumn = array_column($tempatKerja,"tempat_kerja");
|
||||
return response()->json($arrColumn);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Permission;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PermissionsController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Permissions";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = Permission::latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_permission.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_permission.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll['guard_name'] = 'web';
|
||||
Permission::create($requestAll);
|
||||
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(Permission $permission)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
return view('admin.mst_permission.show',compact('permission'));
|
||||
}
|
||||
|
||||
public function edit(Permission $permission)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_permission.edit',compact('permission'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Permission $permission)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$permission->update($requestAll);
|
||||
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(Permission $permission)
|
||||
{
|
||||
$permission->delete();
|
||||
return redirect()->route('permissions.index')
|
||||
->with('success','Permission berhasil dihapus!');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Roless;
|
||||
use App\Models\RolePermission;
|
||||
use App\Models\Permission;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RolessController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Roles";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data = Roless::where("name","<>","superadmin")->latest()->paginate(10);
|
||||
|
||||
return view('admin.mst_role.index',compact('data'))
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('admin.mst_role.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required'
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$requestAll['guard_name'] = 'web';
|
||||
Roless::create($requestAll);
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil dibuat.');
|
||||
}
|
||||
|
||||
public function show(Roless $roless)
|
||||
{
|
||||
$this->setSubtitle("Detail Data");
|
||||
$permissions = Permission::get();
|
||||
$rolePermissions = RolePermission::where("role_id",$roless->id)->get()->toArray();
|
||||
$rolePermissions = array_column($rolePermissions, 'permission_id');
|
||||
return view('admin.mst_role.show',compact('roless','permissions','rolePermissions'));
|
||||
}
|
||||
|
||||
public function edit(Roless $roless)
|
||||
{
|
||||
$this->setSubtitle("Ubah Data");
|
||||
return view('admin.mst_role.edit',compact('roless'));
|
||||
}
|
||||
|
||||
public function update(Request $request, Roless $roless)
|
||||
{
|
||||
$request->validate([
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
$roless->update($requestAll);
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil diubah!');
|
||||
}
|
||||
|
||||
public function permissions($roleId, Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'role_permission' => 'required',
|
||||
]);
|
||||
|
||||
$requestAll = $request->all();
|
||||
RolePermission::where("role_id", $roleId)->delete();
|
||||
$role_permission = $requestAll["role_permission"];
|
||||
foreach($role_permission as $row_permission){
|
||||
RolePermission::create([
|
||||
"permission_id"=>$row_permission,
|
||||
"role_id"=>$roleId
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil diubah!');
|
||||
}
|
||||
|
||||
public function destroy(Roless $roless)
|
||||
{
|
||||
$roless->delete();
|
||||
return redirect()->route('roless.index')
|
||||
->with('success','Role berhasil dihapus!');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Validator;
|
||||
use Hash;
|
||||
use Session;
|
||||
use App\Models\User;
|
||||
use App\Models\RoleUser;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
public function showFormLogin()
|
||||
{
|
||||
if (Auth::check()) { // true sekalian session field di users nanti bisa dipanggil via Auth
|
||||
//Login Success
|
||||
return redirect()->route('home');
|
||||
}
|
||||
return view('login');
|
||||
}
|
||||
|
||||
public function login(Request $request)
|
||||
{
|
||||
$rules = [
|
||||
'nrk' => 'required|string',
|
||||
'password' => 'required|string'
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'nrk.required' => 'NRK wajib diisi',
|
||||
'nrk.string' => 'NRK tidak valid',
|
||||
'password.required' => 'Password wajib diisi',
|
||||
'password.string' => 'Password harus berupa string'
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if($validator->fails()){
|
||||
return redirect()->back()->withErrors($validator)->withInput($request->all);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'nrk' => $request->input('nrk'),
|
||||
'password' => $request->input('password'),
|
||||
];
|
||||
|
||||
Auth::attempt($data);
|
||||
|
||||
if (Auth::check()) { // true sekalian session field di users nanti bisa dipanggil via Auth
|
||||
//Login Success
|
||||
return redirect()->route('home');
|
||||
|
||||
} else { // false
|
||||
|
||||
//Login Fail
|
||||
Session::flash('error', 'NRK atau password salah');
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function showFormRegister()
|
||||
{
|
||||
return view('register');
|
||||
}
|
||||
|
||||
public function register(Request $request)
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|min:3|max:35',
|
||||
'nrk' => 'required|min:5|unique:users,nrk',
|
||||
'password' => 'required|confirmed'
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'name.required' => 'Nama Lengkap wajib diisi',
|
||||
'name.min' => 'Nama lengkap minimal 3 karakter',
|
||||
'name.max' => 'Nama lengkap maksimal 35 karakter',
|
||||
'nrk.required' => 'NRK wajib diisi',
|
||||
'nrk.min' => 'NRK tidak valid',
|
||||
'nrk.unique' => 'NRK sudah terdaftar',
|
||||
'password.required' => 'Password wajib diisi',
|
||||
'password.confirmed' => 'Password tidak sama dengan konfirmasi password'
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if($validator->fails()){
|
||||
return redirect()->back()->withErrors($validator)->withInput($request->all);
|
||||
}
|
||||
|
||||
$user = new User;
|
||||
$user->name = ucwords(strtolower($request->name));
|
||||
$user->nrk = strtolower($request->nrk);
|
||||
$user->password = Hash::make($request->password);
|
||||
// $user->email_verified_at = \Carbon\Carbon::now();
|
||||
$simpan = $user->save();
|
||||
|
||||
$roleUser = new RoleUser;
|
||||
$roleUser->role_id = 3;
|
||||
$roleUser->user_id = $user->id;
|
||||
$roleUser->save();
|
||||
|
||||
if($simpan){
|
||||
Session::flash('success', 'Register berhasil! Silahkan login untuk mengakses data');
|
||||
return redirect()->route('login');
|
||||
} else {
|
||||
Session::flash('errors', ['' => 'Register gagal! Silahkan ulangi beberapa saat lagi']);
|
||||
return redirect()->route('register');
|
||||
}
|
||||
}
|
||||
|
||||
public function logout()
|
||||
{
|
||||
Auth::logout(); // menghapus session yang aktif
|
||||
return redirect()->route('login');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use View;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
public $siteTitle = "Beranda";
|
||||
public $sitesubTitle = "Data";
|
||||
public $siteBreadcumb =[["url"=>"/","label"=>"Beranda"]];
|
||||
|
||||
public function __construct() {
|
||||
View::share ( 'siteTitle' , $this->siteTitle );
|
||||
View::share ( 'sitesubTitle' , $this->sitesubTitle );
|
||||
View::share ( 'siteBreadcumb' , $this->siteBreadcumb );
|
||||
}
|
||||
|
||||
public function setSubtitle($name){
|
||||
View::share ( 'sitesubTitle' , $name );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
|
||||
public function uploadThis(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'file' => 'required',
|
||||
]);
|
||||
|
||||
$file = $request->file('file');
|
||||
$fileContent = $file->get();
|
||||
// echo 'File Name: '.$file->getClientOriginalName();
|
||||
// echo 'File Extension: '.$file->getClientOriginalExtension();
|
||||
// echo 'File Real Path: '.$file->getRealPath();
|
||||
// echo 'File Size: '.$file->getSize();
|
||||
// echo 'File Mime Type: '.$file->getMimeType();
|
||||
|
||||
// Encrypt File
|
||||
$encryptedContent = encrypt($fileContent);
|
||||
\Storage::put('file.dat', $encryptedContent);
|
||||
}
|
||||
|
||||
public function downloadThis(Request $request)
|
||||
{
|
||||
// Decrypt File
|
||||
$encryptedContent = \Storage::get('file.dat');
|
||||
$decryptedContent = decrypt($encryptedContent);
|
||||
|
||||
return response()->streamDownload(function() use ($decryptedContent) {
|
||||
echo $decryptedContent;
|
||||
}, 'file.jpg');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\SubKegiatan;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ItemSearchController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function sk(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$tropd = SubKegiatan::select(["SUBKEG_KODE as id","SUBKEG_NAMA as name"])
|
||||
->where('SUBKEG_NAMA', 'LIKE', "%$search%")
|
||||
->distinct()
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
|
||||
public function rsk(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$tropd = Tropd::select(["I_ID as id","N_OPD as name"])
|
||||
->where('N_OPD', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\TxSkpp;
|
||||
use Illuminate\Http\Request;
|
||||
use PHPJasper\PHPJasper;
|
||||
|
||||
class LaporanController extends Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Laporan";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->setSubtitle("Laporan");
|
||||
return view('laporan.index');
|
||||
}
|
||||
|
||||
public function showReport(Request $request)
|
||||
{
|
||||
$req = $request->all();
|
||||
$date = explode("-", $req["periode"]);
|
||||
$params = [
|
||||
"Periode"=>$req["report_type"],
|
||||
"Date1"=>ConvertIndoDate(trim($date[0])),
|
||||
"Date2"=>ConvertIndoDate(trim($date[1])),
|
||||
];
|
||||
// var_dump($params); exit;
|
||||
$fileReport = reportProceed("laporan_skpp","laporan_skpp", $params);
|
||||
return response()->file($fileReport);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\MstGolongan;
|
||||
use App\Models\MstKantor;
|
||||
use App\Models\MstKeputusan;
|
||||
use App\Models\MstHak;
|
||||
use App\Models\MstUnit;
|
||||
use App\Models\TxSkpp;
|
||||
use App\Models\TxSkppHst;
|
||||
use App\Models\TxKeluarga;
|
||||
use App\Models\TxTerbilang;
|
||||
use App\Models\TxSkppUtang;
|
||||
use App\Exports\SkppHstExport;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
|
||||
class SalurdanaController extends Controller
|
||||
{
|
||||
public function __construct(){
|
||||
$this->siteTitle = "Data Salur Dana";
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('salurdana.index')
|
||||
->with('i', (request()->input('page', 1) - 1) * 10);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// if (!Auth::user()->can("Tambah SKPP")){
|
||||
// abort(403, 'Youre not allowed to visit this page!');
|
||||
// }
|
||||
$this->setSubtitle("Tambah Data");
|
||||
return view('salurdana.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
try{
|
||||
$date = date("Ymd");
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
// var_dump($req); exit;
|
||||
$data = $this->setInputData($req);
|
||||
$noUrut = date("ymd")."00001";
|
||||
$cekNoUrut = TxSkpp::select(["id_pen"])
|
||||
->whereRaw("date(created_at)='".date("Y-m-d")."'")
|
||||
->orderBy("created_at","DESC")
|
||||
->first();
|
||||
|
||||
if ($cekNoUrut){
|
||||
$noUrut = substr($cekNoUrut["id_pen"], -5) + 1;
|
||||
$noUrut = date("ymd").substr("00000".$noUrut, -5);
|
||||
}
|
||||
|
||||
$data["id_pen"] = $noUrut;
|
||||
$data["no_skpp"] = $noUrut."/SKPP/073.521";
|
||||
$data["created_by"] = Auth::user()->id;
|
||||
|
||||
$cekData = TxSkpp::where("nip", $data["nip"])
|
||||
->orWhere("nrk", $data["nrk"])
|
||||
->first();
|
||||
|
||||
if ($cekData){
|
||||
throw new \Exception("Data dengan NIP ".$data["nip"]." Sudah ada");
|
||||
}
|
||||
|
||||
$TSkpp = TxSkpp::create($data);
|
||||
DB::commit();
|
||||
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('success','SKPP berhasil dibuat.');
|
||||
}catch(\Exception $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('error',$e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
protected function setInputData($req){
|
||||
$dinas = MstUnit::where("N_OPD", $req["personal"]["nama_dinas"])->first();
|
||||
|
||||
$data["nama"]=$req["personal"]["nama"];
|
||||
$data["nip"]=$req["personal"]["nip"];
|
||||
$data["nrk"]=$req["personal"]["nrk"];
|
||||
$data["golongan"]=$req["personal"]["golongan_id"];
|
||||
$data["status_pegawai"]=$req["personal"]["status_kepegawaian"];
|
||||
$data["id_unit"]=isset($dinas["I_ID"])?$dinas["I_ID"]:0;
|
||||
$data["dinas"]=$req["personal"]["nama_dinas"];
|
||||
$data["tugas"]=$req["personal"]["tempat_tugas"];
|
||||
$data["tgl_akhir"]=ConvertIndoDate($req["personal"]["penerimaan_gaji_akhir"]);
|
||||
$data["id_kep"]=$req["keputusan"]["keputusan_id"];
|
||||
$data["no_pen"]=$req["keputusan"]["nomor"];
|
||||
$data["tgl_pen"]=ConvertIndoDate($req["keputusan"]["tgl"]);
|
||||
$data["id_hak"]=$req["keputusan"]["hak_id"];
|
||||
$data["tgl_tmt"]=ConvertIndoDate($req["keputusan"]["tmt"]);
|
||||
$data["keterangan"]=$req["keputusan"]["keterangan_kantor"];
|
||||
$data["nama_kantor1"]=$req["keputusan"]["nama_kantor1"];
|
||||
$data["nama_kantor2"]=$req["keputusan"]["nama_kantor2"];
|
||||
$data["wilayah"]=$req["keputusan"]["wilayah_kantor"];
|
||||
$data["ga_pok"]=replaceMoney($req["rincian_gaji"]["gaji_pokok"]);
|
||||
$data["t_issum"]=replaceMoney($req["rincian_gaji"]["tunjangan_suami_istri"]);
|
||||
$data["t_anak"]=replaceMoney($req["rincian_gaji"]["tunjangan_anak"]);
|
||||
$data["t_lain"]=replaceMoney($req["rincian_gaji"]["tunjangan_lain"]);
|
||||
$data["t_jab"]=replaceMoney($req["rincian_gaji"]["tunjangan_jabatan"]);
|
||||
$data["t_beras"]=replaceMoney($req["rincian_gaji"]["tunjangan_beras"]);
|
||||
$data["tpph"]=replaceMoney($req["rincian_gaji"]["tunjangan_pph"]);
|
||||
$data["bulat"]=replaceMoney($req["rincian_gaji"]["pembulatan"]);
|
||||
$data["p_beras"]=replaceMoney($req["rincian_gaji"]["potongan_beras"]);
|
||||
$data["iuran"]=replaceMoney($req["rincian_gaji"]["potongan_iuran_pfk"]);
|
||||
$data["ppph"]=replaceMoney($req["rincian_gaji"]["potongan_pph"]);
|
||||
$data["lain_2"]=replaceMoney($req["rincian_gaji"]["potongan_lain"]);
|
||||
$data["potong"]=replaceMoney($req["rincian_gaji"]["total_potongan"]); // Total Seluruh potongan
|
||||
$data["gaber"]=replaceMoney($req["rincian_gaji"]["total_gaji_bersih"]); // Total gaji bersih
|
||||
$data["u_gaji1"]=null; // Hutang Gaji 1 date
|
||||
$data["u_gaji2"]=null; // Hutang Gaji 2 date
|
||||
$data["jml_u_gaji"]=0; // Total Hutang Gaji
|
||||
$data["u_beras1"]=null; // Hutang Beras 1 date
|
||||
$data["u_beras2"]=null; // Hutang Beras 2 date
|
||||
$data["jml_u_beras"]=0; // Total Hutang Beras
|
||||
$data["id_kan"]=$req["personal_kepala"]["kantor"];
|
||||
$data["status_id"]=1;
|
||||
$data["id_kpkd"]=$req["id_kpkd"];
|
||||
$data["total_utang"]=replaceMoney($req["rincian_utang"]["total"]);
|
||||
$data["total_utang_angsur"]=replaceMoney($req["rincian_utang"]["angsur"]);
|
||||
$data["total_utang_sisa"]=replaceMoney($req["rincian_utang"]["sisa_utang"]);
|
||||
|
||||
$family = isset($req["family"])?$req["family"]:null;
|
||||
TxKeluarga::where("nip",$data["nip"])->delete();
|
||||
if ($family){
|
||||
foreach($family["nama"] as $key=>$itemFamilyName){
|
||||
if ($itemFamilyName){
|
||||
$dataFamily["nip"] = $data["nip"];
|
||||
$dataFamily["nama"] = $itemFamilyName;
|
||||
$dataFamily["tgl_lahir"] = $family["tgl_lahir"][$key]?ConvertIndoDate($family["tgl_lahir"][$key]):null;
|
||||
$dataFamily["hubungan"] = $family["hubungan"][$key];
|
||||
TxKeluarga::create($dataFamily);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$debt = $req["debt"];
|
||||
if ($debt){
|
||||
TxSkppUtang::where("nip",$data["nip"])->delete();
|
||||
foreach($debt["deskripsi"] as $key=>$itemDebt){
|
||||
if ($itemDebt){
|
||||
$dataDebt["nip"] = $data["nip"];
|
||||
$dataDebt["uraian"] = $itemDebt;
|
||||
$dataDebt["jumlah"] = $debt["jumlah"][$key]?replaceMoney($debt["jumlah"][$key]):0;
|
||||
TxSkppUtang::create($dataDebt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function show(TxSkpp $TxSkpp)
|
||||
{
|
||||
if (!Auth::user()->can("Lihat SKPP")){
|
||||
abort(403, 'Youre not allowed to visit this page!');
|
||||
}
|
||||
$this->setSubtitle("Detail Data");
|
||||
$txSkpp = TxSkpp::where("id", $TxSkpp->id)->with(["mst_golongan","mst_utang","mst_keputusan","mst_hak","mst_kantor"])->first();
|
||||
$txSkppHst = TxSkppHst::where("tx_skpp_id", $TxSkpp->id)->with(["mst_golongan","mst_keputusan","mst_hak","mst_kantor"])->orderBy("created_at","DESC")->get();
|
||||
return view('salurdana.show',compact("txSkpp","txSkppHst"));
|
||||
}
|
||||
|
||||
public function edit(TxSkpp $txSkpp)
|
||||
{
|
||||
if (!Auth::user()->can("Ubah SKPP")){
|
||||
abort(403, 'Youre not allowed to visit this page!');
|
||||
}
|
||||
$this->setSubtitle("Ubah Data");
|
||||
$f_edit = "edit";
|
||||
return view('salurdana.edit',compact("txSkpp","f_edit"));
|
||||
}
|
||||
|
||||
public function update(Request $request, TxSkpp $txSkpp)
|
||||
{
|
||||
try{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$req = $request->all();
|
||||
$data = $this->setInputData($req);
|
||||
$data["updated_by"] = Auth::user()->id;
|
||||
$txSkpp->update($data);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('success','SKPP berhasil diubah.');
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('error','SKPP gagal diubah!');
|
||||
}
|
||||
}
|
||||
|
||||
public function revisi($id)
|
||||
{
|
||||
if (!Auth::user()->can("Ubah SKPP")){
|
||||
abort(403, 'Youre not allowed to visit this page!');
|
||||
}
|
||||
$txSkpp = TxSkpp::where("id", $id)->first();
|
||||
$this->setSubtitle("Revisi Data");
|
||||
$f_edit = "revisi";
|
||||
return view('salurdana.edit',compact("txSkpp","f_edit"));
|
||||
}
|
||||
|
||||
public function revisiStore(Request $request, $id)
|
||||
{
|
||||
try{
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$txSkpp = TxSkpp::where("id", $id)->first();
|
||||
$txtSkppRevisi = $txSkpp->toArray();
|
||||
$txtSkppRevisi["tx_skpp_id"]=$txtSkppRevisi["id"];
|
||||
unset($txtSkppRevisi["id"]);
|
||||
TxSkppHst::create($txtSkppRevisi);
|
||||
|
||||
$req = $request->all();
|
||||
$revisiNo = intval($txSkpp->f_revisi) + 1;
|
||||
$data = $this->setInputData($req);
|
||||
$data["f_revisi"]=$revisiNo;
|
||||
$data["tgl_cetak"]=null;
|
||||
$data["no_skpp"]="R".$revisiNo."/".$txSkpp->id_pen."/SKPP/073.521";
|
||||
$data["revisi_remarks"]=$req["personal"]["alasan_revisi"];
|
||||
$data["revised_at"] = date("Y-m-d H:i");
|
||||
$data["revised_by"] = Auth::user()->id;
|
||||
$txSkpp->update($data);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('success','SKPP berhasil direvisi.');
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('error','SKPP gagal direvisi!');
|
||||
}
|
||||
}
|
||||
|
||||
public function destroy(TxSkpp $txSkpp)
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
// $txSkpp->delete();
|
||||
$txSkpp->update(["f_deleted"=>1,"deleted_at"=>date("Y-m-d H:i"), "deleted_by"=>Auth::user()->id]);
|
||||
// TxKeluarga::where("nip",$txSkpp["nip"])->delete();
|
||||
// TxSkppUtang::where("nip",$txSkpp["nip"])->delete();
|
||||
DB::commit();
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('success','SKPP berhasil dihapus!');
|
||||
|
||||
}catch(Throwable $e){
|
||||
|
||||
DB::rollBack();
|
||||
return redirect()->route('tx-salurdana.index')
|
||||
->with('error','SKPP gagal di hapus.');
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
{
|
||||
$post = $request->all();
|
||||
$offset = $post["start"];
|
||||
$limit = $post["length"];
|
||||
$src = $post["src"];
|
||||
$srcdate1 = $post["srcDate1"];
|
||||
$srcdate2 = $post["srcDate2"];
|
||||
$statusCetak = $post["statusCetak"];
|
||||
$jenisTgl = $post["jenisTgl"];
|
||||
|
||||
$data = []; $dataFilter=0;
|
||||
$select = DB::raw("id,no_skpp,CONVERT(created_at, DATE) AS tgldibuat,CONVERT(tgl_cetak, DATE) AS tgldicetak,no_pen,nrk,nip,nama,tgl_cetak,f_migrasi_data");
|
||||
if ($src){
|
||||
$data = TxSkpp::select($select)
|
||||
->where("nrk","like","%$src%")
|
||||
->orWhere("nip","like","%$src%")
|
||||
->orWhere("nama","like","%$src%")
|
||||
->orWhere("no_pen","like","%$src%")
|
||||
->orWhere("no_skpp","like","$src%");
|
||||
|
||||
}else{
|
||||
$data = TxSkpp::select($select);
|
||||
}
|
||||
|
||||
$data->whereNull("f_deleted");
|
||||
|
||||
if ($srcdate1 && $srcdate2){
|
||||
$data->whereDate($jenisTgl, ">=", ConvertIndoDate($srcdate1));
|
||||
$data->whereDate($jenisTgl, "<=", ConvertIndoDate($srcdate2));
|
||||
}
|
||||
|
||||
if ($statusCetak){
|
||||
if ($statusCetak == "sudah"){
|
||||
$data->whereNotNull("tgl_cetak");
|
||||
}else{
|
||||
$data->whereNull("tgl_cetak");
|
||||
}
|
||||
}
|
||||
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = TxSkpp::count();
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->orderBy("created_at","DESC")->skip($offset)->take($limit)->get()
|
||||
]);
|
||||
}
|
||||
|
||||
function updateTerbilang($idSKPP, $val){
|
||||
TxTerbilang::where("tx_skpp_id",$idSKPP)->delete();
|
||||
return TxTerbilang::create(["tx_skpp_id"=>$idSKPP, "description"=>terbilang($val)]);
|
||||
}
|
||||
|
||||
public function getPegawai(Request $request){
|
||||
// NRK = 178998 181188 181199
|
||||
// $NRK = "181199";
|
||||
$response = Http::withHeaders(
|
||||
['Authorization' => 'Basic ' . base64_encode(env("SOA_PEGAWAI_USER").":".env("SOA_PEGAWAI_PASSWORD"))])
|
||||
->accept('application/json')
|
||||
->get(env("SOA_PEGAWAI")."?nrk=".$request->NRK);
|
||||
$getData = $response->json();
|
||||
if (count($getData["results"])>0){
|
||||
$PEG = $getData["results"][0];
|
||||
$iuranPFK = doubleval($PEG["POTONGAN_THT"]) + doubleval($PEG["POTONGAN_TASPEN"]) + doubleval($PEG["POTONGAN_ASKES_GAJI"]);
|
||||
$tunjanganLain = doubleval($PEG["TUNJANGAN_LAIN"]) + doubleval($PEG["TUNJANGAN_FUNGSIONAL"]);
|
||||
return response()->json([
|
||||
"THBL" => $PEG["THBL"],
|
||||
"NRK"=>$PEG["NRK"],
|
||||
"NAMA"=>$PEG["NAMA"],
|
||||
"NIP"=>$PEG["NIP"],
|
||||
"GOLONGAN"=>$PEG["GOLONGAN"],
|
||||
"PANGKAT"=>$PEG["PANGKAT"],
|
||||
"STATUS"=>$PEG["STATUS"],
|
||||
"PERANGKAT_DAERAH"=>$PEG["PERANGKAT_DAERAH"],
|
||||
"UNIT_KERJA"=>$PEG["UNIT_KERJA"],
|
||||
"GAPOK"=>separateNumberIndo($PEG["GAPOK"]),
|
||||
"NAMA_PASANGAN"=>$PEG["NAMA_PASANGAN"],
|
||||
"TUNJANGAN_ISTRI_SUAMI"=>separateNumberIndo($PEG["TUNJANGAN_ISTRI_SUAMI"]),
|
||||
"TANGGAL_LAHIR_PASANGAN"=>$PEG["TANGGAL_LAHIR_PASANGAN"] == "" ? "":date("d/m/Y",strtotime($PEG["TANGGAL_LAHIR_PASANGAN"])),
|
||||
"ANAKTUNJANG1"=>$PEG["ANAKTUNJANG1"],
|
||||
"TGLAHIRANAK1"=>$PEG["TGLAHIRANAK1"] == "" ? "": date("d/m/Y",strtotime($PEG["TGLAHIRANAK1"])),
|
||||
"ANAKTUNJANG2"=>$PEG["ANAKTUNJANG2"],
|
||||
"TGLAHIRANAK2"=>$PEG["TGLAHIRANAK2"] == "" ? "": date("d/m/Y",strtotime($PEG["TGLAHIRANAK2"])),
|
||||
"ANAKTUNJANG3"=>$PEG["ANAKTUNJANG3"],
|
||||
"TGLAHIRANAK3"=>$PEG["TGLAHIRANAK3"] == "" ? "": date("d/m/Y",strtotime($PEG["TGLAHIRANAK3"])),
|
||||
"TUNJANGAN_ANAK"=>separateNumberIndo($PEG["TUNJANGAN_ANAK"]),
|
||||
"TUNJANGAN_JABATAN"=>separateNumberIndo($PEG["TUNJANGAN_JABATAN"]),
|
||||
"TUNJANGAN_LAIN"=>separateNumberIndo($tunjanganLain),
|
||||
"TUNJANGAN_BERAS"=>separateNumberIndo($PEG["TUNJANGAN_BERAS"]),
|
||||
"TUNJANGAN_PPH"=>0,
|
||||
"PEMBULATAN"=>separateNumberIndo($PEG["PEMBULATAN"]),
|
||||
"IURAN_PFK"=>separateNumberIndo($iuranPFK),
|
||||
"POTONGAN_BERAS"=>0,
|
||||
"POTONGAN_PPH"=>0,
|
||||
"POTONGAN_LAIN"=>0
|
||||
]);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function printData(Request $request)
|
||||
{
|
||||
$req = $request->all();
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
$txSkpp = txSkpp::where("id",$req["id_skpp"])->first();
|
||||
$txSkpp->update(["tgl_cetak"=>date("Y-m-d")]);
|
||||
$this->updateTerbilang($req["id_skpp"], $txSkpp->gaber);
|
||||
|
||||
DB::commit();
|
||||
|
||||
$params = [
|
||||
"ParamId"=>$req["id_skpp"],
|
||||
"serverLocation"=>public_path()
|
||||
];
|
||||
|
||||
$fileReport = reportProceed("skpp","skpp", $params);
|
||||
return response()->file($fileReport);
|
||||
}
|
||||
|
||||
public function exportHst(Request $request, $id)
|
||||
{
|
||||
$req = $request->all();
|
||||
return Excel::download(new SkppHstExport($id),'skpp_hst.xlsx');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Tropd;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SkpdController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function selectSearch(Request $request)
|
||||
{
|
||||
$tropd = [];
|
||||
|
||||
if($request->has('q')){
|
||||
$search = strtoupper($request->q);
|
||||
$tropd = Tropd::select(["I_ID as id","N_OPD as name"])
|
||||
->where('N_OPD', 'LIKE', "%$search%")
|
||||
->get();
|
||||
}
|
||||
return response()->json($tropd);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Fruitcake\Cors\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
'throttle:api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
// 'role' => \App\Http\Middleware\CheckRole::class,
|
||||
'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
|
||||
'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
|
||||
'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('login');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CheckRole
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ... $roles)
|
||||
{
|
||||
$hasRole = false;
|
||||
foreach($roles as $role){
|
||||
if ($request->user()->hasRole($role)) {
|
||||
$hasRole = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$hasRole){
|
||||
abort(403, 'This action is unauthorized.');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null ...$guards
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, ...$guards)
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function hosts()
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstGolongan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_golongan';
|
||||
protected $fillable = [
|
||||
'nama_golongan', 'nama_pangkat', 'golongan_besar','alias'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstHak extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_hak';
|
||||
protected $fillable = [
|
||||
'nama_hak'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstKantor extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_kantor';
|
||||
protected $fillable = [
|
||||
'nama_kantor', 'wilayah'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstKeputusan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_keputusan';
|
||||
protected $fillable = [
|
||||
'id', 'nama_keputusan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstKpkd extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_kpkd';
|
||||
protected $fillable = [
|
||||
'nama', 'nip', 'nrk', 'status_id'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstTempatKerja extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_tempatkerja';
|
||||
protected $fillable = [
|
||||
'skpd_id', 'skpd_name', 'tempat_kerja'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MstUnit extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'mst_unit';
|
||||
protected $fillable = [];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Permission extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'permissions';
|
||||
protected $fillable = [
|
||||
'name', 'guard_name'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Role extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RolePermission extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
public $timestamps = false;
|
||||
|
||||
protected $table = 'role_has_permissions';
|
||||
protected $fillable = [
|
||||
'permission_id','role_id'
|
||||
];
|
||||
|
||||
public function role() {
|
||||
return $this->belongsTo('App\Models\Roless','role_id','id');
|
||||
}
|
||||
|
||||
public function permission() {
|
||||
return $this->belongsTo('App\Models\Permission','permission_id','id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RoleUser extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'role_id',
|
||||
'user_id',
|
||||
];
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function role()
|
||||
{
|
||||
return $this->belongsTo(Role::class, 'role_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Spatie\Permission\Traits\HasPermissions;
|
||||
|
||||
class Roless extends Model
|
||||
{
|
||||
use HasFactory, HasPermissions;
|
||||
protected $table = 'roless';
|
||||
protected $fillable = [
|
||||
'name','guard_name'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class SubKegiatan extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle2';
|
||||
protected $table = 'BAPEDA_BUDGETING.P_SPB_BELANJARINCIAKB';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Yajra\Oci8\Eloquent\OracleEloquent as Eloquent;
|
||||
|
||||
class Tropd extends Eloquent
|
||||
{
|
||||
use HasFactory;
|
||||
protected $connection = 'oracle';
|
||||
protected $table = 'NEWSIPKD.TROPD';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TxKeluarga extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tx_keluarga';
|
||||
protected $fillable = [
|
||||
'nip', 'nama', 'tgl_lahir','hubungan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TxSkpp extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tx_skpp';
|
||||
protected $fillable = [
|
||||
"id_pen",
|
||||
"nama",
|
||||
"nip",
|
||||
"nrk",
|
||||
"golongan",
|
||||
"status_pegawai",
|
||||
"tugas",
|
||||
"dinas",
|
||||
"tgl_akhir",
|
||||
"akhir",
|
||||
"id_kep",
|
||||
"no_pen",
|
||||
"tgl_pen",
|
||||
"id_hak",
|
||||
"tgl_tmt",
|
||||
"ga_pok",
|
||||
"t_issum",
|
||||
"t_anak",
|
||||
"t_lain",
|
||||
"t_jab",
|
||||
"t_beras",
|
||||
"tpph",
|
||||
"bulat",
|
||||
"p_beras",
|
||||
"iuran",
|
||||
"ppph",
|
||||
"lain_2",
|
||||
"potong",
|
||||
"gaber",
|
||||
"u_gaji1",
|
||||
"u_gaji2",
|
||||
"jml_u_gaji",
|
||||
"u_beras1",
|
||||
"u_beras2",
|
||||
"jml_u_beras",
|
||||
"id_kan",
|
||||
"kon_peg",
|
||||
"status_id",
|
||||
"tgl_cetak",
|
||||
"tgl_peg",
|
||||
"keterangan",
|
||||
"nama_kantor1",
|
||||
"nama_kantor2",
|
||||
"wilayah",
|
||||
"no_skpp",
|
||||
"id_unit",
|
||||
"f_revisi",
|
||||
"revisi_remarks",
|
||||
"id_kpkd",
|
||||
"created_by",
|
||||
"updated_by",
|
||||
"revised_at",
|
||||
"revised_by",
|
||||
"total_utang",
|
||||
"total_utang_angsur",
|
||||
"total_utang_sisa",
|
||||
"f_deleted",
|
||||
"deleted_at",
|
||||
"deleted_by"
|
||||
];
|
||||
|
||||
public function mst_keluarga() {
|
||||
return $this->hasMany('App\Models\TxKeluarga','nip','nip');
|
||||
}
|
||||
|
||||
public function mst_utang() {
|
||||
return $this->hasMany('App\Models\TxSkppUtang','nip','nip');
|
||||
}
|
||||
|
||||
public function mst_golongan() {
|
||||
return $this->belongsTo('App\Models\MstGolongan','golongan','id');
|
||||
}
|
||||
|
||||
public function mst_keputusan() {
|
||||
return $this->belongsTo('App\Models\MstKeputusan','id_kep','id');
|
||||
}
|
||||
|
||||
public function mst_hak() {
|
||||
return $this->belongsTo('App\Models\MstHak','id_hak', 'id');
|
||||
}
|
||||
|
||||
public function mst_kantor() {
|
||||
return $this->belongsTo('App\Models\MstKantor','id_kan','id');
|
||||
}
|
||||
|
||||
public function mst_kpkd() {
|
||||
return $this->belongsTo('App\Models\MstKpkd','id_kpkd','id');
|
||||
}
|
||||
|
||||
public function user() {
|
||||
return $this->belongsTo('App\Models\User','created_by','id');
|
||||
}
|
||||
|
||||
public function user_revisi() {
|
||||
return $this->belongsTo('App\Models\User','revised_by','id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TxSkppHst extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tx_skpp_hst';
|
||||
protected $fillable = [
|
||||
"id_pen",
|
||||
"nama",
|
||||
"nip",
|
||||
"nrk",
|
||||
"golongan",
|
||||
"status_pegawai",
|
||||
"tugas",
|
||||
"dinas",
|
||||
"tgl_akhir",
|
||||
"akhir",
|
||||
"id_kep",
|
||||
"no_pen",
|
||||
"tgl_pen",
|
||||
"id_hak",
|
||||
"tgl_tmt",
|
||||
"ga_pok",
|
||||
"t_issum",
|
||||
"t_anak",
|
||||
"t_lain",
|
||||
"t_jab",
|
||||
"t_beras",
|
||||
"tpph",
|
||||
"bulat",
|
||||
"p_beras",
|
||||
"iuran",
|
||||
"ppph",
|
||||
"lain_2",
|
||||
"potong",
|
||||
"gaber",
|
||||
"u_gaji1",
|
||||
"u_gaji2",
|
||||
"jml_u_gaji",
|
||||
"u_beras1",
|
||||
"u_beras2",
|
||||
"jml_u_beras",
|
||||
"id_kan",
|
||||
"kon_peg",
|
||||
"status_id",
|
||||
"tgl_cetak",
|
||||
"tgl_peg",
|
||||
"keterangan",
|
||||
"nama_kantor1",
|
||||
"nama_kantor2",
|
||||
"wilayah",
|
||||
"no_skpp",
|
||||
"id_unit",
|
||||
"f_revisi",
|
||||
"revisi_remarks",
|
||||
"tx_skpp_id"
|
||||
];
|
||||
|
||||
public function mst_keluarga() {
|
||||
return $this->hasMany('App\Models\TxKeluarga','nip','nip');
|
||||
}
|
||||
|
||||
public function mst_golongan() {
|
||||
return $this->belongsTo('App\Models\MstGolongan','golongan','id');
|
||||
}
|
||||
|
||||
public function mst_keputusan() {
|
||||
return $this->belongsTo('App\Models\MstKeputusan','id_kep','id');
|
||||
}
|
||||
|
||||
public function mst_hak() {
|
||||
return $this->belongsTo('App\Models\MstHak','id_hak', 'id');
|
||||
}
|
||||
|
||||
public function mst_kantor() {
|
||||
return $this->belongsTo('App\Models\MstKantor','id_kan','id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TxSkppUtang extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tx_skpp_utang';
|
||||
protected $fillable = [
|
||||
"nip",
|
||||
"uraian",
|
||||
"jumlah",
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class TxTerbilang extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tx_terbilang';
|
||||
protected $fillable = [
|
||||
'tx_skpp_id', 'description'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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 Illuminate\Support\Str;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable, HasRoles;
|
||||
public $incrementing = false;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'nrk',
|
||||
'password',
|
||||
'role_name'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
//'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function roleUser()
|
||||
{
|
||||
return $this->hasOne(RoleUser::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
protected static function boot() {
|
||||
static::creating(function ($model) {
|
||||
if (!$model->id){
|
||||
$model->id = (string) Str::uuid();
|
||||
}
|
||||
});
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
public function authorizeRoles($roles)
|
||||
{
|
||||
if ($this->hasAnyRole($roles)) {
|
||||
return true;
|
||||
}
|
||||
abort(403, 'This action is unauthorized.');
|
||||
}
|
||||
|
||||
// public function hasAnyRole($roles)
|
||||
// {
|
||||
// if (is_array($roles)) {
|
||||
// foreach ($roles as $role) {
|
||||
// if ($this->hasRole($role)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if ($this->hasRole($roles)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// public function hasRole($role)
|
||||
// {
|
||||
// $hasRole = $this->roleUser()->with(["role"=>function($query) use ($role){
|
||||
// $query->where("name",$role);
|
||||
// }])->first();
|
||||
|
||||
// if ($hasRole->role){
|
||||
// return true;
|
||||
// }else{
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class VwSkppHst extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'vw_skpp_hst';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Paginator::useBootstrap();
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
*
|
||||
* This is used by Laravel authentication to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/home';
|
||||
|
||||
/**
|
||||
* The controller namespace for the application.
|
||||
*
|
||||
* When present, controller route declarations will automatically be prefixed with this namespace.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
// protected $namespace = 'App\\Http\\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function () {
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
{
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components;
|
||||
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class breadcrumb extends Component
|
||||
{
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Closure|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.breadcrumb');
|
||||
}
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
use PHPJasper\PHPJasper;
|
||||
|
||||
function ConvertIndoDate($val){
|
||||
if ($val == null){
|
||||
return null;
|
||||
}
|
||||
|
||||
$arr_date = explode("/", $val);
|
||||
return $arr_date[2] ."-".$arr_date[1]."-".$arr_date[0];
|
||||
}
|
||||
|
||||
function SetToIndoDate($val,$monthYear=false, $full=false){
|
||||
$Month_name = array("","Januari","Februari","Maret",
|
||||
"April","Mei","Juni","Juli","Agustus",
|
||||
"September","Oktober","November","Desember");
|
||||
|
||||
if ($val == null) return "";
|
||||
if ($monthYear){
|
||||
return $Month_name[intval(date("m",strtotime($val)))]." ".date("Y",strtotime($val));
|
||||
}else{
|
||||
if ($full){
|
||||
return date("d",strtotime($val))." ".$Month_name[intval(date("m",strtotime($val)))]." ".date("Y",strtotime($val));
|
||||
}else{
|
||||
return date("d-m-Y",strtotime($val));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function replaceMoney($val){
|
||||
return doubleval(preg_replace("/\D/","",$val));
|
||||
}
|
||||
|
||||
function separateNumberIndo($val){
|
||||
// $numberFormatter = new NumberFormatter( 'id_ID', NumberFormatter::DECIMAL );
|
||||
$numberFormatter = number_format($val);
|
||||
$numberFormatter = str_replace([","],["."],$numberFormatter);
|
||||
return $numberFormatter;
|
||||
}
|
||||
|
||||
function terbilang($val){
|
||||
switch($val){
|
||||
case $val>=1 && $val<=11:
|
||||
$arrBil = ["","Satu","Dua","Tiga","Empat","Lima","Enam","Tujuh","Delapan","Sembilan","Sepuluh","Sebelas"];
|
||||
return $arrBil[$val];
|
||||
break;
|
||||
case $val>=12 && $val<=19:
|
||||
return terbilang($val % 10)." Belas ";
|
||||
break;
|
||||
case $val>=20 && $val<=99:
|
||||
return terbilang(floor($val / 10))." Puluh ".trim(terbilang($val % 10));
|
||||
break;
|
||||
case $val>=100 && $val<=199:
|
||||
return "Seratus ".terbilang($val % 100);
|
||||
break;
|
||||
case $val>=200 && $val<=999:
|
||||
return terbilang(floor($val / 100))." Ratus ".trim(terbilang($val % 100));
|
||||
break;
|
||||
case $val>=1000 && $val<=1999:
|
||||
return "Seribu ".terbilang($val % 1000);
|
||||
break;
|
||||
case $val>=2000 && $val<=999999:
|
||||
return terbilang(floor($val / 1000))." Ribu ".trim(terbilang($val % 1000));
|
||||
break;
|
||||
case $val>=1000000 && $val<=999999999:
|
||||
return terbilang(floor($val / 1000000))." Juta ".trim(terbilang($val % 1000000));
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function reportProceed($source, $reportName, $params = []){
|
||||
$input = resource_path("views/laporan/$source.jrxml");
|
||||
$output = storage_path('app');
|
||||
$options = [
|
||||
'format' => ['pdf'],
|
||||
'params' => $params,
|
||||
'local'=>'en',
|
||||
'db_connection' => [
|
||||
'driver' => 'mysql',
|
||||
'username' => env('DB_USERNAME'),
|
||||
'password' => env('DB_PASSWORD'),
|
||||
'host' => env('DB_HOST'),
|
||||
'database' => env('DB_DATABASE'),
|
||||
'port' => env('DB_PORT')
|
||||
]
|
||||
];
|
||||
|
||||
$jasper = new PHPJasper;
|
||||
$jasper->process(
|
||||
$input,
|
||||
$output,
|
||||
$options
|
||||
)->execute();
|
||||
|
||||
return $output."/$reportName.pdf";
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any of our classes manually. It's great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Artisan Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When we run the console application, the current CLI command will be
|
||||
| executed in this console and the response sent back to a terminal
|
||||
| or another output device for the developers. Here goes nothing!
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
|
||||
$status = $kernel->handle(
|
||||
$input = new Symfony\Component\Console\Input\ArgvInput,
|
||||
new Symfony\Component\Console\Output\ConsoleOutput
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running, we will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel->terminate($input, $status);
|
||||
|
||||
exit($status);
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Important Interfaces
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, we need to bind some important interfaces into the container so
|
||||
| we will be able to resolve them when needed. The kernels serve the
|
||||
| incoming requests to this application from both the web and CLI.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Http\Kernel::class,
|
||||
App\Http\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Console\Kernel::class,
|
||||
App\Console\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||
App\Exceptions\Handler::class
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^7.3|^8.0",
|
||||
"fruitcake/laravel-cors": "^2.0",
|
||||
"geekcom/phpjasper": "^3.3",
|
||||
"guzzlehttp/guzzle": "^7.0.1",
|
||||
"laravel/framework": "^8.54",
|
||||
"laravel/sanctum": "^2.11",
|
||||
"laravel/tinker": "^2.5",
|
||||
"maatwebsite/excel": "^3.1",
|
||||
"spatie/laravel-permission": "^5.3",
|
||||
"yajra/laravel-oci8": "^8"
|
||||
},
|
||||
"require-dev": {
|
||||
"facade/ignition": "^2.5",
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/sail": "^1.0.1",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
"nunomaduro/collision": "^5.10",
|
||||
"phpunit/phpunit": "^9.5.8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
},
|
||||
"files": [
|
||||
"app/helpers.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
Generated
+8695
File diff suppressed because it is too large
Load Diff
+236
@@ -0,0 +1,236 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application. This value is used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| any other location as required by the application or its packages.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the "environment" your application is currently
|
||||
| running in. This may determine how you prefer to configure various
|
||||
| services the application utilizes. Set this in your ".env" file.
|
||||
|
|
||||
*/
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
'asset_url' => env('ASSET_URL', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. We have gone
|
||||
| ahead and set this to a sensible default for you out of the box.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'Asia/Jakarta',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Fallback Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The fallback locale determines the locale to use when the current one
|
||||
| is not available. You may change the value to correspond to any of
|
||||
| the language folders that are provided through your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'fallback_locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Faker Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This locale will be used by the Faker PHP library when generating fake
|
||||
| data for your database seeds. For example, this will be used to get
|
||||
| localized telephone numbers, street address information and more.
|
||||
|
|
||||
*/
|
||||
|
||||
'faker_locale' => 'en_US',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service providers listed here will be automatically loaded on the
|
||||
| request to your application. Feel free to add your own services to
|
||||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'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\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
Yajra\Oci8\Oci8ServiceProvider::class,
|
||||
Spatie\Permission\PermissionServiceProvider::class,
|
||||
Maatwebsite\Excel\ExcelServiceProvider::class,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array of class aliases will be registered when this application
|
||||
| is started. However, feel free to register as many as you wish as
|
||||
| the aliases are "lazy" loaded so they don't hinder performance.
|
||||
|
|
||||
*/
|
||||
|
||||
'aliases' => [
|
||||
|
||||
'App' => Illuminate\Support\Facades\App::class,
|
||||
'Arr' => Illuminate\Support\Arr::class,
|
||||
'Artisan' => Illuminate\Support\Facades\Artisan::class,
|
||||
'Auth' => Illuminate\Support\Facades\Auth::class,
|
||||
'Blade' => Illuminate\Support\Facades\Blade::class,
|
||||
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
|
||||
'Bus' => Illuminate\Support\Facades\Bus::class,
|
||||
'Cache' => Illuminate\Support\Facades\Cache::class,
|
||||
'Config' => Illuminate\Support\Facades\Config::class,
|
||||
'Cookie' => Illuminate\Support\Facades\Cookie::class,
|
||||
'Crypt' => Illuminate\Support\Facades\Crypt::class,
|
||||
'Date' => Illuminate\Support\Facades\Date::class,
|
||||
'DB' => Illuminate\Support\Facades\DB::class,
|
||||
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
|
||||
'Event' => Illuminate\Support\Facades\Event::class,
|
||||
'File' => Illuminate\Support\Facades\File::class,
|
||||
'Gate' => Illuminate\Support\Facades\Gate::class,
|
||||
'Hash' => Illuminate\Support\Facades\Hash::class,
|
||||
'Http' => Illuminate\Support\Facades\Http::class,
|
||||
'Lang' => Illuminate\Support\Facades\Lang::class,
|
||||
'Log' => Illuminate\Support\Facades\Log::class,
|
||||
'Mail' => Illuminate\Support\Facades\Mail::class,
|
||||
'Notification' => Illuminate\Support\Facades\Notification::class,
|
||||
'Password' => Illuminate\Support\Facades\Password::class,
|
||||
'Queue' => Illuminate\Support\Facades\Queue::class,
|
||||
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
|
||||
'Redirect' => Illuminate\Support\Facades\Redirect::class,
|
||||
// 'Redis' => Illuminate\Support\Facades\Redis::class,
|
||||
'Request' => Illuminate\Support\Facades\Request::class,
|
||||
'Response' => Illuminate\Support\Facades\Response::class,
|
||||
'Route' => Illuminate\Support\Facades\Route::class,
|
||||
'Schema' => Illuminate\Support\Facades\Schema::class,
|
||||
'Session' => Illuminate\Support\Facades\Session::class,
|
||||
'Storage' => Illuminate\Support\Facades\Storage::class,
|
||||
'Str' => Illuminate\Support\Str::class,
|
||||
'URL' => Illuminate\Support\Facades\URL::class,
|
||||
'Validator' => Illuminate\Support\Facades\Validator::class,
|
||||
'View' => Illuminate\Support\Facades\View::class,
|
||||
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
|
||||
],
|
||||
|
||||
];
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default authentication "guard" and password
|
||||
| reset options for your application. You may change these defaults
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => 'web',
|
||||
'passwords' => 'users',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| here which uses session storage and the Eloquent user provider.
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| sources which represent each model / table. These sources may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify multiple password reset configurations if you have more
|
||||
| than one user table or model in the application and you want to have
|
||||
| separate password reset settings based on the specific user types.
|
||||
|
|
||||
| The expire time is the number of minutes that the reset token should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the amount of seconds before a password confirmation
|
||||
| times out and the user is prompted to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => 10800,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Broadcaster
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default broadcaster that will be used by the
|
||||
| framework when an event needs to be broadcast. You may set this to
|
||||
| any of the connections defined in the "connections" array below.
|
||||
|
|
||||
| Supported: "pusher", "ably", "redis", "log", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('BROADCAST_DRIVER', 'null'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the broadcast connections that will be used
|
||||
| to broadcast events to other systems or over websockets. Samples of
|
||||
| each available type of connection are provided inside this array.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'pusher' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'useTLS' => true,
|
||||
],
|
||||
],
|
||||
|
||||
'ably' => [
|
||||
'driver' => 'ably',
|
||||
'key' => env('ABLY_KEY'),
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'driver' => 'log',
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'null',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "apc", "array", "database", "file",
|
||||
| "memcached", "redis", "dynamodb", "octane", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'apc' => [
|
||||
'driver' => 'apc',
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
'lock_connection' => null,
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'cache',
|
||||
'lock_connection' => 'default',
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing a RAM based store such as APC or Memcached, there might
|
||||
| be other applications utilizing the same cache. So, we'll specify a
|
||||
| value to get prefixed to all our keys so we can avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
|
||||
|
||||
];
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cross-Origin Resource Sharing (CORS) Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure your settings for cross-origin resource sharing
|
||||
| or "CORS". This determines what cross-origin operations may execute
|
||||
| in web browsers. You are free to adjust these settings as needed.
|
||||
|
|
||||
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
|
||||
'allowed_origins_patterns' => [],
|
||||
|
||||
'allowed_headers' => ['*'],
|
||||
|
||||
'exposed_headers' => [],
|
||||
|
||||
'max_age' => 0,
|
||||
|
||||
'supports_credentials' => false,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,171 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'mysql'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'schema' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
],
|
||||
|
||||
'oracle' => [
|
||||
'driver' => 'oracle',
|
||||
'host' => env('ORA_HOST', 'localhost'),
|
||||
'port' => env('ORA_PORT', '1521'),
|
||||
'database' => env('ORA_DATABASE', 'xe'),
|
||||
'service_name' => env('ORA_SERVICENAME', 'xe'),
|
||||
'username' => env('ORA_USERNAME', 'hr'),
|
||||
'password' => env('ORA_PASSWORD', 'hr'),
|
||||
'charset' => '',
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
'oracle2' => [
|
||||
'driver' => 'oracle',
|
||||
'host' => env('ORA_HOST2', 'localhost'),
|
||||
'port' => env('ORA_PORT2', '1521'),
|
||||
'database' => env('ORA_DATABASE2', 'xe'),
|
||||
'service_name' => env('ORA_SERVICENAME2', 'xe'),
|
||||
'username' => env('ORA_USERNAME2', 'hr'),
|
||||
'password' => env('ORA_PASSWORD2', 'hr'),
|
||||
'charset' => '',
|
||||
'prefix' => '',
|
||||
]
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'password' => env('REDIS_PASSWORD', null),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php
|
||||
|
||||
use Maatwebsite\Excel\Excel;
|
||||
|
||||
return [
|
||||
'exports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Chunk size
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using FromQuery, the query is automatically chunked.
|
||||
| Here you can specify how big the chunk should be.
|
||||
|
|
||||
*/
|
||||
'chunk_size' => 1000,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Pre-calculate formulas during export
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pre_calculate_formulas' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable strict null comparison
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When enabling strict null comparison empty cells ('') will
|
||||
| be added to the sheet.
|
||||
*/
|
||||
'strict_null_comparison' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'line_ending' => PHP_EOL,
|
||||
'use_bom' => false,
|
||||
'include_separator_line' => false,
|
||||
'excel_compatibility' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
],
|
||||
|
||||
'imports' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Read Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might only be interested in the
|
||||
| data that the sheet exists. By default we ignore all styles,
|
||||
| however if you want to do some logic based on style data
|
||||
| you can enable it by setting read_only to false.
|
||||
|
|
||||
*/
|
||||
'read_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ignore Empty
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with imports, you might be interested in ignoring
|
||||
| rows that have null values or empty strings. By default rows
|
||||
| containing empty strings or empty values are not ignored but can be
|
||||
| ignored by enabling the setting ignore_empty to true.
|
||||
|
|
||||
*/
|
||||
'ignore_empty' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading Row Formatter
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure the heading row formatter.
|
||||
| Available options: none|slug|custom
|
||||
|
|
||||
*/
|
||||
'heading_row' => [
|
||||
'formatter' => 'slug',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSV Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
||||
|
|
||||
*/
|
||||
'csv' => [
|
||||
'delimiter' => ',',
|
||||
'enclosure' => '"',
|
||||
'escape_character' => '\\',
|
||||
'contiguous' => false,
|
||||
'input_encoding' => 'UTF-8',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Worksheet properties
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure e.g. default title, creator, subject,...
|
||||
|
|
||||
*/
|
||||
'properties' => [
|
||||
'creator' => '',
|
||||
'lastModifiedBy' => '',
|
||||
'title' => '',
|
||||
'description' => '',
|
||||
'subject' => '',
|
||||
'keywords' => '',
|
||||
'category' => '',
|
||||
'manager' => '',
|
||||
'company' => '',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Extension detector
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which writer/reader type should be used when the package
|
||||
| needs to guess the correct type based on the extension alone.
|
||||
|
|
||||
*/
|
||||
'extension_detector' => [
|
||||
'xlsx' => Excel::XLSX,
|
||||
'xlsm' => Excel::XLSX,
|
||||
'xltx' => Excel::XLSX,
|
||||
'xltm' => Excel::XLSX,
|
||||
'xls' => Excel::XLS,
|
||||
'xlt' => Excel::XLS,
|
||||
'ods' => Excel::ODS,
|
||||
'ots' => Excel::ODS,
|
||||
'slk' => Excel::SLK,
|
||||
'xml' => Excel::XML,
|
||||
'gnumeric' => Excel::GNUMERIC,
|
||||
'htm' => Excel::HTML,
|
||||
'html' => Excel::HTML,
|
||||
'csv' => Excel::CSV,
|
||||
'tsv' => Excel::TSV,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDF Extension
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Configure here which Pdf driver should be used by default.
|
||||
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
||||
|
|
||||
*/
|
||||
'pdf' => Excel::DOMPDF,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Value Binder
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| PhpSpreadsheet offers a way to hook into the process of a value being
|
||||
| written to a cell. In there some assumptions are made on how the
|
||||
| value should be formatted. If you want to change those defaults,
|
||||
| you can implement your own default value binder.
|
||||
|
|
||||
| Possible value binders:
|
||||
|
|
||||
| [x] Maatwebsite\Excel\DefaultValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
|
||||
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
||||
|
|
||||
*/
|
||||
'value_binder' => [
|
||||
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default cell caching driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default PhpSpreadsheet keeps all cell values in memory, however when
|
||||
| dealing with large files, this might result into memory issues. If you
|
||||
| want to mitigate that, you can configure a cell caching driver here.
|
||||
| When using the illuminate driver, it will store each value in a the
|
||||
| cache store. This can slow down the process, because it needs to
|
||||
| store each value. You can use the "batch" store if you want to
|
||||
| only persist to the store when the memory limit is reached.
|
||||
|
|
||||
| Drivers: memory|illuminate|batch
|
||||
|
|
||||
*/
|
||||
'driver' => 'memory',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Batch memory caching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with the "batch" caching driver, it will only
|
||||
| persist to the store when the memory limit is reached.
|
||||
| Here you can tweak the memory limit to your liking.
|
||||
|
|
||||
*/
|
||||
'batch' => [
|
||||
'memory_limit' => 60000,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Illuminate cache
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "illuminate" caching driver, it will automatically use
|
||||
| your default cache store. However if you prefer to have the cell
|
||||
| cache on a separate store, you can configure the store name here.
|
||||
| You can use any store defined in your cache config. When leaving
|
||||
| at "null" it will use the default store.
|
||||
|
|
||||
*/
|
||||
'illuminate' => [
|
||||
'store' => null,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Transaction Handler
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default the import is wrapped in a transaction. This is useful
|
||||
| for when an import may fail and you want to retry it. With the
|
||||
| transactions, the previous import gets rolled-back.
|
||||
|
|
||||
| You can disable the transaction handler by setting this to null.
|
||||
| Or you can choose a custom made transaction handler here.
|
||||
|
|
||||
| Supported handlers: null|db
|
||||
|
|
||||
*/
|
||||
'transactions' => [
|
||||
'handler' => 'db',
|
||||
],
|
||||
|
||||
'temporary_files' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Local Temporary Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When exporting and importing files, we use a temporary file, before
|
||||
| storing reading or downloading. Here you can customize that path.
|
||||
|
|
||||
*/
|
||||
'local_path' => storage_path('framework/cache/laravel-excel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Remote Temporary Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup with queues in which you
|
||||
| cannot rely on having a shared local temporary path, you might
|
||||
| want to store the temporary file on a shared disk. During the
|
||||
| queue executing, we'll retrieve the temporary file from that
|
||||
| location instead. When left to null, it will always use
|
||||
| the local path. This setting only has effect when using
|
||||
| in conjunction with queued imports and exports.
|
||||
|
|
||||
*/
|
||||
'remote_disk' => null,
|
||||
'remote_prefix' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Force Resync
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When dealing with a multi server setup as above, it's possible
|
||||
| for the clean up that occurs after entire queue has been run to only
|
||||
| cleanup the server that the last AfterImportJob runs on. The rest of the server
|
||||
| would still have the local temporary file stored on it. In this case your
|
||||
| local storage limits can be exceeded and future imports won't be processed.
|
||||
| To mitigate this you can set this config value to be true, so that after every
|
||||
| queued chunk is processed the local temporary file is deleted on the server that
|
||||
| processed it.
|
||||
|
|
||||
*/
|
||||
'force_resync_remote' => null,
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application. Just store away!
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been setup for each driver as an example of the required options.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Symbolic Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the symbolic links that will be created when the
|
||||
| `storage:link` Artisan command is executed. The array keys should be
|
||||
| the locations of the links and the values should be their targets.
|
||||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default hash driver that will be used to hash
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon", "argon2id"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 10),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 1024,
|
||||
'threads' => 2,
|
||||
'time' => 2,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that gets used when writing
|
||||
| messages to the logs. The name specified in this option should match
|
||||
| one of the channels defined in the "channels" configuration array.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog",
|
||||
| "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['single'],
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => 14,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => 'Laravel Log',
|
||||
'emoji' => ':boom:',
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => SyslogUdpHandler::class,
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default mailer that is used to send any email
|
||||
| messages sent by your application. Alternative mailers may be setup
|
||||
| and used as needed; however, this mailer will be used by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('MAIL_MAILER', 'smtp'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailer Configurations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure all of the mailers used by your application plus
|
||||
| their respective settings. Several examples have been configured for
|
||||
| you and you are free to add your own as your application requires.
|
||||
|
|
||||
| Laravel supports a variety of mail "transport" drivers to be used while
|
||||
| sending an e-mail. You will specify which one you are using for your
|
||||
| mailers below. You are free to add additional mailers as required.
|
||||
|
|
||||
| Supported: "smtp", "sendmail", "mailgun", "ses",
|
||||
| "postmark", "log", "array", "failover"
|
||||
|
|
||||
*/
|
||||
|
||||
'mailers' => [
|
||||
'smtp' => [
|
||||
'transport' => 'smtp',
|
||||
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
||||
'port' => env('MAIL_PORT', 587),
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'auth_mode' => null,
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'mailgun' => [
|
||||
'transport' => 'mailgun',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => '/usr/sbin/sendmail -bs',
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'transport' => 'log',
|
||||
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'transport' => 'array',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'transport' => 'failover',
|
||||
'mailers' => [
|
||||
'smtp',
|
||||
'log',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => [
|
||||
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Markdown Mail Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using Markdown based email rendering, you may configure your
|
||||
| theme and component paths here, allowing you to customize the design
|
||||
| of the emails. Or, you may simply stick with the Laravel defaults!
|
||||
|
|
||||
*/
|
||||
|
||||
'markdown' => [
|
||||
'theme' => 'default',
|
||||
|
||||
'paths' => [
|
||||
resource_path('views/vendor/mail'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'models' => [
|
||||
|
||||
/*
|
||||
* When using the "HasPermissions" trait from this package, we need to know which
|
||||
* Eloquent model should be used to retrieve your permissions. Of course, it
|
||||
* is often just the "Permission" model but you may use whatever you like.
|
||||
*
|
||||
* The model you want to use as a Permission model needs to implement the
|
||||
* `Spatie\Permission\Contracts\Permission` contract.
|
||||
*/
|
||||
|
||||
'permission' => Spatie\Permission\Models\Permission::class,
|
||||
|
||||
/*
|
||||
* When using the "HasRoles" trait from this package, we need to know which
|
||||
* Eloquent model should be used to retrieve your roles. Of course, it
|
||||
* is often just the "Role" model but you may use whatever you like.
|
||||
*
|
||||
* The model you want to use as a Role model needs to implement the
|
||||
* `Spatie\Permission\Contracts\Role` contract.
|
||||
*/
|
||||
|
||||
'role' => Spatie\Permission\Models\Role::class,
|
||||
|
||||
],
|
||||
|
||||
'table_names' => [
|
||||
|
||||
/*
|
||||
* When using the "HasRoles" trait from this package, we need to know which
|
||||
* table should be used to retrieve your roles. We have chosen a basic
|
||||
* default value but you may easily change it to any table you like.
|
||||
*/
|
||||
|
||||
'roles' => 'roless',
|
||||
|
||||
/*
|
||||
* When using the "HasPermissions" trait from this package, we need to know which
|
||||
* table should be used to retrieve your permissions. We have chosen a basic
|
||||
* default value but you may easily change it to any table you like.
|
||||
*/
|
||||
|
||||
'permissions' => 'permissions',
|
||||
|
||||
/*
|
||||
* When using the "HasPermissions" trait from this package, we need to know which
|
||||
* table should be used to retrieve your models permissions. We have chosen a
|
||||
* basic default value but you may easily change it to any table you like.
|
||||
*/
|
||||
|
||||
'model_has_permissions' => 'model_has_permissions',
|
||||
|
||||
/*
|
||||
* When using the "HasRoles" trait from this package, we need to know which
|
||||
* table should be used to retrieve your models roles. We have chosen a
|
||||
* basic default value but you may easily change it to any table you like.
|
||||
*/
|
||||
|
||||
'model_has_roles' => 'model_has_roles',
|
||||
|
||||
/*
|
||||
* When using the "HasRoles" trait from this package, we need to know which
|
||||
* table should be used to retrieve your roles permissions. We have chosen a
|
||||
* basic default value but you may easily change it to any table you like.
|
||||
*/
|
||||
|
||||
'role_has_permissions' => 'role_has_permissions',
|
||||
],
|
||||
|
||||
'column_names' => [
|
||||
/*
|
||||
* Change this if you want to name the related pivots other than defaults
|
||||
*/
|
||||
'role_pivot_key' => null, //default 'role_id',
|
||||
'permission_pivot_key' => null, //default 'permission_id',
|
||||
|
||||
/*
|
||||
* Change this if you want to name the related model primary key other than
|
||||
* `model_id`.
|
||||
*
|
||||
* For example, this would be nice if your primary keys are all UUIDs. In
|
||||
* that case, name this `model_uuid`.
|
||||
*/
|
||||
|
||||
'model_morph_key' => 'model_id',
|
||||
|
||||
/*
|
||||
* Change this if you want to use the teams feature and your related model's
|
||||
* foreign key is other than `team_id`.
|
||||
*/
|
||||
|
||||
'team_foreign_key' => 'team_id',
|
||||
],
|
||||
|
||||
/*
|
||||
* When set to true, the method for checking permissions will be registered on the gate.
|
||||
* Set this to false, if you want to implement custom logic for checking permissions.
|
||||
*/
|
||||
|
||||
'register_permission_check_method' => true,
|
||||
|
||||
/*
|
||||
* When set to true the package implements teams using the 'team_foreign_key'. If you want
|
||||
* the migrations to register the 'team_foreign_key', you must set this to true
|
||||
* before doing the migration. If you already did the migration then you must make a new
|
||||
* migration to also add 'team_foreign_key' to 'roles', 'model_has_roles', and
|
||||
* 'model_has_permissions'(view the latest version of package's migration file)
|
||||
*/
|
||||
|
||||
'teams' => false,
|
||||
|
||||
/*
|
||||
* When set to true, the required permission names are added to the exception
|
||||
* message. This could be considered an information leak in some contexts, so
|
||||
* the default setting is false here for optimum safety.
|
||||
*/
|
||||
|
||||
'display_permission_in_exception' => false,
|
||||
|
||||
/*
|
||||
* When set to true, the required role names are added to the exception
|
||||
* message. This could be considered an information leak in some contexts, so
|
||||
* the default setting is false here for optimum safety.
|
||||
*/
|
||||
|
||||
'display_role_in_exception' => false,
|
||||
|
||||
/*
|
||||
* By default wildcard permission lookups are disabled.
|
||||
*/
|
||||
|
||||
'enable_wildcard_permission' => false,
|
||||
|
||||
'cache' => [
|
||||
|
||||
/*
|
||||
* By default all permissions are cached for 24 hours to speed up performance.
|
||||
* When permissions or roles are updated the cache is flushed automatically.
|
||||
*/
|
||||
|
||||
'expiration_time' => \DateInterval::createFromDateString('24 hours'),
|
||||
|
||||
/*
|
||||
* The cache key used to store all permissions.
|
||||
*/
|
||||
|
||||
'key' => 'spatie.permission.cache',
|
||||
|
||||
/*
|
||||
* You may optionally indicate a specific cache driver to use for permission and
|
||||
* role caching using any of the `store` drivers listed in the cache.php config
|
||||
* file. Using 'default' here means to use the `default` set in cache.php.
|
||||
*/
|
||||
|
||||
'store' => 'default',
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel's queue API supports an assortment of back-ends via a single
|
||||
| API, giving you convenient access to each back-end using the same
|
||||
| syntax for every one. Here you may define a default connection.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('QUEUE_CONNECTION', 'sync'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection information for each server that
|
||||
| is used by your application. A default configuration has been added
|
||||
| for each back-end shipped with Laravel. You are free to add more.
|
||||
|
|
||||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sync' => [
|
||||
'driver' => 'sync',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'jobs',
|
||||
'queue' => 'default',
|
||||
'retry_after' => 90,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'beanstalkd' => [
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => 'localhost',
|
||||
'queue' => 'default',
|
||||
'retry_after' => 90,
|
||||
'block_for' => 0,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'sqs' => [
|
||||
'driver' => 'sqs',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||
'queue' => env('SQS_QUEUE', 'default'),
|
||||
'suffix' => env('SQS_SUFFIX'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => 90,
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Failed Queue Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These options configure the behavior of failed queue job logging so you
|
||||
| can control which database and table are used to store the jobs that
|
||||
| have failed. You may change them to any database / table you wish.
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => [
|
||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||
'database' => env('DB_CONNECTION', 'mysql'),
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Stateful Domains
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Requests from the following domains / hosts will receive stateful API
|
||||
| authentication cookies. Typically, these should include your local
|
||||
| and production domains which access your API via a frontend SPA.
|
||||
|
|
||||
*/
|
||||
|
||||
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
|
||||
))),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expiration Minutes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value controls the number of minutes until an issued token will be
|
||||
| considered expired. If this value is null, personal access tokens do
|
||||
| not expire. This won't tweak the lifetime of first-party sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'expiration' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When authenticating your first-party SPA with Sanctum you may need to
|
||||
| customize some of the middleware Sanctum uses while processing the
|
||||
| request. You may change the middleware listed below as required.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
|
||||
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Third Party Services
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is for storing the credentials for third party services such
|
||||
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||
| location for this type of information, allowing packages to have
|
||||
| a conventional file to locate the various service credentials.
|
||||
|
|
||||
*/
|
||||
|
||||
'mailgun' => [
|
||||
'domain' => env('MAILGUN_DOMAIN'),
|
||||
'secret' => env('MAILGUN_SECRET'),
|
||||
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'token' => env('POSTMARK_TOKEN'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,201 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "dynamodb", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire on the browser closing, set that option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to easily specify that all of your session data
|
||||
| should be encrypted before it is stored. All encryption will be run
|
||||
| automatically by Laravel and you can use the Session like normal.
|
||||
|
|
||||
*/
|
||||
|
||||
'encrypt' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path('framework/sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => env('SESSION_CONNECTION', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| While using one of the framework's cache driven session backends you may
|
||||
| list a cache store that should be used for these sessions. This value
|
||||
| must match with one of the application's configured cache "stores".
|
||||
|
|
||||
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => env('SESSION_STORE', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => [2, 100],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('SESSION_DOMAIN', null),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you when it can't be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Access Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will prevent JavaScript from accessing the
|
||||
| value of the cookie and the cookie will only be accessible through
|
||||
| the HTTP protocol. You are free to modify this option if needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'http_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Same-Site Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how your cookies behave when cross-site requests
|
||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||
| will set this value to "lax" since this is a secure default value.
|
||||
|
|
||||
| Supported: "lax", "strict", "none", null
|
||||
|
|
||||
*/
|
||||
|
||||
'same_site' => 'lax',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| View Storage Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Most templating systems load templates from disk. Here you may specify
|
||||
| an array of paths that should be checked for your views. Of course
|
||||
| the usual Laravel view path has already been registered for you.
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => [
|
||||
resource_path('views'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Compiled View Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines where all the compiled Blade templates will be
|
||||
| stored for your application. Typically, this is within the storage
|
||||
| directory. However, as usual, you are free to change this value.
|
||||
|
|
||||
*/
|
||||
|
||||
'compiled' => env(
|
||||
'VIEW_COMPILED_PATH',
|
||||
realpath(storage_path('framework/views'))
|
||||
),
|
||||
|
||||
];
|
||||
@@ -0,0 +1 @@
|
||||
*.sqlite*
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* The name of the factory's corresponding model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $model = User::class;
|
||||
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function definition()
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->name(),
|
||||
'email' => $this->faker->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 \Illuminate\Database\Eloquent\Factories\Factory
|
||||
*/
|
||||
public function unverified()
|
||||
{
|
||||
return $this->state(function (array $attributes) {
|
||||
return [
|
||||
'email_verified_at' => null,
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('name');
|
||||
$table->string('nrk')->unique();
|
||||
// $table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable 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();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateFailedJobsTable 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();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePersonalAccessTokensTable 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->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('personal_access_tokens');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateRolesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('roles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->string('description');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('roles');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateRoleUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('role_users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer('role_id')->unsigned();
|
||||
$table->UUID('user_id');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('role_users');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
<?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');
|
||||
$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');
|
||||
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->uuid($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')
|
||||
->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->uuid($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')
|
||||
->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')
|
||||
->on($tableNames['permissions'])
|
||||
->onDelete('cascade');
|
||||
|
||||
$table->foreign(PermissionRegistrar::$pivotRole)
|
||||
->references('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']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSalurDanaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('salur_dana', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->date('tgl_salur');
|
||||
$table->string('kode_skpd', 50);
|
||||
$table->string('kode_sub_kegiatan', 50);
|
||||
$table->double('jumlah', 19, 2);
|
||||
$table->datetime('approved_at');
|
||||
$table->string('approved_by',36);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('salur_dana');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateSalurDanaDetailsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('salur_dana_details', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('salur_dana_id', 36);
|
||||
$table->string('kode_rsk', 50);
|
||||
$table->string('kode_rekening', 50);
|
||||
$table->double('jumlah_salur_anggaran', 19, 2);
|
||||
$table->double('jumlah_salur_skpd', 19, 2);
|
||||
$table->double('jumlah_salur_realisasi', 19, 2);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('salur_dana_details');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application's database.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// \App\Models\User::factory(10)->create();
|
||||
//$this->call(PermissionSeeder::class);
|
||||
//$this->call(RolesTableSeeder::class);
|
||||
$this->call(UsersTableSeeder::class);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Spatie\Permission\Models\Role;
|
||||
use Spatie\Permission\Models\Permission;
|
||||
use Spatie\Permission\PermissionRegistrar;
|
||||
|
||||
class PermissionSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
app()[PermissionRegistrar::class]->forgetCachedPermissions();
|
||||
Role::create(['name' => 'superadmin']);
|
||||
Role::create(['name' => 'admin']);
|
||||
Role::create(['name' => 'anggaran']);
|
||||
Role::create(['name' => 'skpd']);
|
||||
Role::create(['name' => 'bendahara']);
|
||||
|
||||
// $Permission0 = Permission::create(['name' => 'Lihat SKPP']);
|
||||
// $Permission1 = Permission::create(['name' => 'Tambah SKPP']);
|
||||
// $Permission2 = Permission::create(['name' => 'Ubah SKPP']);
|
||||
// $Permission3 = Permission::create(['name' => 'Hapus SKPP']);
|
||||
// $Permission4 = Permission::create(['name' => 'Cetak SKPP']);
|
||||
// $Permission5 = Permission::create(['name' => 'Cetak Laporan SKPP']);
|
||||
|
||||
// $roleSuperadmin = Role::create(['name' => 'superadmin']);
|
||||
// $roleSuperadmin->givePermissionTo($Permission0);
|
||||
|
||||
// $roleAdmin = Role::create(['name' => 'admin']);
|
||||
// $roleAdmin->givePermissionTo($Permission0);
|
||||
|
||||
// $roleUser = Role::create(['name' => 'user']);
|
||||
// $roleUser->givePermissionTo($Permission0);
|
||||
// $roleUser->givePermissionTo($Permission1);
|
||||
// $roleUser->givePermissionTo($Permission2);
|
||||
// $roleUser->givePermissionTo($Permission3);
|
||||
// $roleUser->givePermissionTo($Permission4);
|
||||
// $roleUser->givePermissionTo($Permission5);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Role;
|
||||
|
||||
class RolesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Role::truncate();
|
||||
|
||||
$role = new Role;
|
||||
$role->name = "superadmin";
|
||||
$role->description = "Super Administrator";
|
||||
$role->save();
|
||||
|
||||
$role = new Role;
|
||||
$role->name = "admin";
|
||||
$role->description = "Administrator";
|
||||
$role->save();
|
||||
|
||||
$role = new Role;
|
||||
$role->name = "anggaran";
|
||||
$role->description = "Anggaran";
|
||||
$role->save();
|
||||
|
||||
$role = new Role;
|
||||
$role->name = "skpd";
|
||||
$role->description = "SKPD";
|
||||
$role->save();
|
||||
|
||||
$role = new Role;
|
||||
$role->name = "bendahara";
|
||||
$role->description = "Bendahara";
|
||||
$role->save();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user