commit
d23197a625
|
@ -0,0 +1,18 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
|
@ -0,0 +1,58 @@
|
|||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=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=mailpit
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="hello@example.com"
|
||||
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_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
|
@ -0,0 +1,11 @@
|
|||
* text=auto
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
|
@ -0,0 +1,18 @@
|
|||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
/vendor
|
||||
.env
|
||||
.env.backup
|
||||
.env.production
|
||||
.phpunit.result.cache
|
||||
Homestead.json
|
||||
Homestead.yaml
|
||||
auth.json
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
/.fleet
|
||||
/.idea
|
||||
/.vscode
|
|
@ -0,0 +1,66 @@
|
|||
<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" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.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.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 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)**
|
||||
- **[WebReinvent](https://webreinvent.com/?utm_source=laravel&utm_medium=github&utm_campaign=patreon-sponsors)**
|
||||
- **[Lendio](https://lendio.com)**
|
||||
|
||||
## 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,32 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* 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,96 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class AlternativeDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable
|
||||
->editColumn('objek_id', function ($q) {
|
||||
return $q->name;
|
||||
})
|
||||
->addColumn('action', 'alternatives.datatables_actions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\Alternative $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Alternative $model)
|
||||
{
|
||||
// return $model->newQuery();
|
||||
$query = Alternative::query();
|
||||
$query->leftJoin('objeks', 'alternative.objek_id', 'objeks.id');
|
||||
$query = $query->select(
|
||||
'alternative.id',
|
||||
'alternative.objek_id',
|
||||
'objeks.code',
|
||||
'objeks.name',
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
'objek_id' => ['title' => 'Nama']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'alternatives_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use App\Models\Analysis;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class AnalysisDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable->addColumn('action', 'analyses.datatables_actions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\Analysis $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Analysis $model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
'id' => ['title' => 'ID'],
|
||||
'alternative_id' => ['title' => 'Alternatif ID'],
|
||||
'objek_name' => ['title' => 'Nama Objek'],
|
||||
'criteria1' => ['title' => 'Jarak'],
|
||||
'criteria2' => ['title' => 'Harga'],
|
||||
'criteria3' => ['title' => 'Akses'],
|
||||
'criteria4' => ['title' => 'Fasilitas'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'analyses_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Calculation;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class CalculationDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable->addColumn('action', 'calculations.datatables_actions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\Calculation $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Calculation $model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'calculations_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class CriteriaDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable
|
||||
->editColumn('status', function ($q) {
|
||||
$status = Criteria::$status;
|
||||
return $q->status == 1 ? $status[1] : $status[0];
|
||||
})
|
||||
->addColumn('action', 'criterias.datatables_actions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\Criteria $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Criteria $model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
'code',
|
||||
'criteria_name',
|
||||
'status'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'criterias_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Objek;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class ObjekDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable->addColumn('action', 'objeks.datatables_actions');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\Objek $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Objek $model)
|
||||
{
|
||||
$data = $model->newQuery();
|
||||
$data = $data->orderBy('id');
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
'name'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'objeks_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use App\Models\SubCriteria;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
use Yajra\DataTables\EloquentDataTable;
|
||||
|
||||
class SubCriteriaDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
$dataTable = new EloquentDataTable($query);
|
||||
|
||||
return $dataTable
|
||||
->editColumn('id', function ($q) {
|
||||
$criteria = Criteria::find($q->id);
|
||||
|
||||
return $criteria->criteria_name;
|
||||
})
|
||||
->editColumn('criteria_name', function ($q) {
|
||||
|
||||
$list_group_html = '-';
|
||||
|
||||
$criteria = Criteria::find($q->id);
|
||||
$sub_criteria = SubCriteria::where('criteria_id', $criteria->id)->get();
|
||||
|
||||
if (count($sub_criteria) > 0) {
|
||||
$html = '';
|
||||
foreach ($sub_criteria as $sub) {
|
||||
$html = $html . '<li>' . $sub->value .' = '. $sub->description . '</li>';
|
||||
}
|
||||
|
||||
$list_group_html = '
|
||||
<ul>
|
||||
' . $html . '
|
||||
</ul>
|
||||
';
|
||||
}
|
||||
|
||||
return $list_group_html;
|
||||
})
|
||||
->addColumn('action', 'sub_criterias.datatables_actions')
|
||||
->rawColumns(['action', 'id', 'criteria_name']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Models\SubCriteria $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(SubCriteria $model)
|
||||
{
|
||||
// $query = SubCriteria::query();
|
||||
// $query->leftJoin('criteria', 'criteria.id', 'sub_criteria.criteria_id');
|
||||
// $query = $query->select(
|
||||
// 'sub_criteria.id',
|
||||
// 'criteria_id',
|
||||
// 'description',
|
||||
// 'value',
|
||||
// 'criteria.criteria_name'
|
||||
// );
|
||||
|
||||
$query = Criteria::query();
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->addAction(['width' => '120px', 'printable' => false])
|
||||
->parameters([
|
||||
'dom' => 'Bfrtip',
|
||||
'stateSave' => true,
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
// Enable Buttons as per your need
|
||||
// ['extend' => 'create', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'export', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'print', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reset', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
// ['extend' => 'reload', 'className' => 'btn btn-default btn-sm no-corner',],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
'id' => ['title'=> 'Kriteria'],
|
||||
'criteria_name' => ['title'=> 'Bobot & Keterangan'],
|
||||
// 'value' => ['title'=> 'Bobot']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename(): string
|
||||
{
|
||||
return 'sub_criterias_datatable_' . time();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of exception types with their corresponding custom log levels.
|
||||
*
|
||||
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
|
||||
*/
|
||||
protected $levels = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the exception types that are not reported.
|
||||
*
|
||||
* @var array<int, class-string<\Throwable>>
|
||||
*/
|
||||
protected $dontReport = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* A list of the inputs that are never flashed to the session on validation exceptions.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
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,20 @@
|
|||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Custom
|
||||
{
|
||||
public static function rupiah($angka)
|
||||
{
|
||||
$hasil = 'Rp ' . number_format($angka, 0, ",", ".") . ',-';
|
||||
return $hasil;
|
||||
}
|
||||
|
||||
public static function formatNumber($num)
|
||||
{
|
||||
return number_format($num, 0, ",", ".");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Flash;
|
||||
use App\Models\Objek;
|
||||
use App\Models\Analysis;
|
||||
use App\Models\Criteria;
|
||||
use App\Models\Alternative;
|
||||
use Illuminate\Http\Request;
|
||||
use App\DataTables\AlternativeDataTable;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Repositories\AlternativeRepository;
|
||||
use App\Http\Requests\CreateAlternativeRequest;
|
||||
use App\Http\Requests\UpdateAlternativeRequest;
|
||||
use App\Models\SubCriteria;
|
||||
|
||||
class AlternativeController extends AppBaseController
|
||||
{
|
||||
/** @var AlternativeRepository $alternativeRepository*/
|
||||
private $alternativeRepository;
|
||||
|
||||
public function __construct(AlternativeRepository $alternativeRepo)
|
||||
{
|
||||
$this->alternativeRepository = $alternativeRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Alternative.
|
||||
*/
|
||||
public function index(AlternativeDataTable $alternativeDataTable)
|
||||
{
|
||||
return $alternativeDataTable->render('alternatives.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Alternative.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$objek = Objek::all()->pluck('name', 'id')->toArray();
|
||||
|
||||
return view('alternatives.create', compact('objek'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Alternative in storage.
|
||||
*/
|
||||
public function store(CreateAlternativeRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$alternative = $this->alternativeRepository->create($input);
|
||||
|
||||
// insert into penilaian
|
||||
$criteria = Criteria::get();
|
||||
foreach ($criteria as $key => $value) {
|
||||
$sub = SubCriteria::where('criteria_id', $value->id)->first();
|
||||
$update = Analysis::updateOrCreate(
|
||||
['alternative_id' => $alternative->id, 'criteria_id' => $value->id],
|
||||
['sub_criteria_id' => $sub->id]);
|
||||
}
|
||||
|
||||
Flash::success('Alternative saved successfully.');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Alternative.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$alternative = $this->alternativeRepository->find($id);
|
||||
|
||||
if (empty($alternative)) {
|
||||
Flash::error('Alternative not found');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
return view('alternatives.show')->with('alternative', $alternative);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Alternative.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
// $alternative = $this->alternativeRepository->find($id);
|
||||
$alternative = Alternative::leftJoin('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select(
|
||||
'alternative.id',
|
||||
'alternative.objek_id',
|
||||
'objeks.code',
|
||||
'objeks.name',
|
||||
)
|
||||
->where('alternative.id', $id)
|
||||
->first();
|
||||
// dd($alternative);
|
||||
|
||||
if (empty($alternative)) {
|
||||
Flash::error('Alternative not found');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
$objek = Objek::all()->pluck('name', 'id')->toArray();
|
||||
|
||||
return view('alternatives.edit', compact('objek'))->with('alternative', $alternative);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Alternative in storage.
|
||||
*/
|
||||
public function update($id, UpdateAlternativeRequest $request)
|
||||
{
|
||||
$alternative = $this->alternativeRepository->find($id);
|
||||
|
||||
if (empty($alternative)) {
|
||||
Flash::error('Alternative not found');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
$alternative = $this->alternativeRepository->update($request->all(), $id);
|
||||
|
||||
// insert into penilaian
|
||||
$criteria = Criteria::get();
|
||||
foreach ($criteria as $key => $value) {
|
||||
$sub = SubCriteria::where('criteria_id', $value->id)->first();
|
||||
$update = Analysis::updateOrCreate(
|
||||
['alternative_id' => $alternative->id, 'criteria_id' => $value->id],
|
||||
['sub_criteria_id' => $sub->id]);
|
||||
}
|
||||
|
||||
Flash::success('Alternative updated successfully.');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Alternative from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$alternative = $this->alternativeRepository->find($id);
|
||||
|
||||
if (empty($alternative)) {
|
||||
Flash::error('Alternative not found');
|
||||
|
||||
return redirect(route('alternatives.index'));
|
||||
}
|
||||
|
||||
$this->alternativeRepository->delete($id);
|
||||
|
||||
return $this->sendSuccess('Data berhasil dihapus.');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\DataTables\AnalysisDataTable;
|
||||
use App\Http\Requests\CreateAnalysisRequest;
|
||||
use App\Http\Requests\UpdateAnalysisRequest;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Models\Alternative;
|
||||
use App\Models\Analysis;
|
||||
use App\Models\Criteria;
|
||||
use App\Models\SubCriteria;
|
||||
use App\Repositories\AnalysisRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use Flash;
|
||||
|
||||
class AnalysisController extends AppBaseController
|
||||
{
|
||||
/** @var AnalysisRepository $analysisRepository*/
|
||||
private $analysisRepository;
|
||||
|
||||
public function __construct(AnalysisRepository $analysisRepo)
|
||||
{
|
||||
$this->analysisRepository = $analysisRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Analysis.
|
||||
*/
|
||||
public function index(AnalysisDataTable $analysisDataTable)
|
||||
{
|
||||
\DB::statement("SET SQL_MODE=''");
|
||||
|
||||
$data = Analysis::with('alternatif', 'kriteria', 'subKriteria')->orderBy('id', 'asc')->get();
|
||||
|
||||
$criteria = Criteria::get();
|
||||
|
||||
return view('analyses.index', compact('criteria', 'data'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Analysis.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('analyses.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Analysis in storage.
|
||||
*/
|
||||
public function store(CreateAnalysisRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$analysis = $this->analysisRepository->create($input);
|
||||
|
||||
Flash::success('Analysis saved successfully.');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Analysis.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$analysis = $this->analysisRepository->find($id);
|
||||
|
||||
if (empty($analysis)) {
|
||||
Flash::error('Analysis not found');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
|
||||
return view('analyses.show')->with('analysis', $analysis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Analysis.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$analysis = Analysis::where('alternative_id', $id)->first();
|
||||
|
||||
if (empty($analysis)) {
|
||||
Flash::error('Analysis not found');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
|
||||
$data2 = Analysis::where('alternative_id', $id)->get();
|
||||
$subKriteria = SubCriteria::orderBy('criteria_id')->get();
|
||||
|
||||
return view('analyses.edit', compact('data2', 'subKriteria'))->with('analysis', $analysis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Analysis in storage.
|
||||
*/
|
||||
public function update($id, UpdateAnalysisRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
// update penilaian/analysis
|
||||
$criteria = Criteria::get();
|
||||
|
||||
foreach ($criteria as $key => $value) {
|
||||
$update = Analysis::updateOrCreate(
|
||||
['alternative_id' => $request->alternative_id, 'criteria_id' => $value->id],
|
||||
['sub_criteria_id' => $request->criteria_id[$key]]);
|
||||
}
|
||||
// end update penilaian/analysis
|
||||
|
||||
Flash::success('Analysis updated successfully.');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Analysis from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$analysis = $this->analysisRepository->find($id);
|
||||
|
||||
if (empty($analysis)) {
|
||||
Flash::error('Analysis not found');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
|
||||
$this->analysisRepository->delete($id);
|
||||
|
||||
Flash::success('Analysis deleted successfully.');
|
||||
|
||||
return redirect(route('analyses.index'));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use InfyOm\Generator\Utils\ResponseUtil;
|
||||
|
||||
/**
|
||||
* @OA\Server(url="/api")
|
||||
* @OA\Info(
|
||||
* title="InfyOm Laravel Generator APIs",
|
||||
* version="1.0.0"
|
||||
* )
|
||||
* This class should be parent class for other API controllers
|
||||
* Class AppBaseController
|
||||
*/
|
||||
class AppBaseController extends Controller
|
||||
{
|
||||
public function sendResponse($result, $message)
|
||||
{
|
||||
return response()->json(ResponseUtil::makeResponse($message, $result));
|
||||
}
|
||||
|
||||
public function sendError($error, $code = 404)
|
||||
{
|
||||
return response()->json(ResponseUtil::makeError($error), $code);
|
||||
}
|
||||
|
||||
public function sendSuccess($message)
|
||||
{
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => $message
|
||||
], 200);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\Models\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,211 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Flash;
|
||||
use App\Models\Analysis;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\DataTables\CalculationDataTable;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Repositories\CalculationRepository;
|
||||
use App\Http\Requests\CreateCalculationRequest;
|
||||
use App\Http\Requests\UpdateCalculationRequest;
|
||||
use App\Models\Divider;
|
||||
use App\Models\MatrixNormalization;
|
||||
use App\Models\ResultTopsis;
|
||||
|
||||
class CalculationController extends AppBaseController
|
||||
{
|
||||
/** @var CalculationRepository $calculationRepository*/
|
||||
private $calculationRepository;
|
||||
|
||||
public function __construct(CalculationRepository $calculationRepo)
|
||||
{
|
||||
$this->calculationRepository = $calculationRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Calculation.
|
||||
*/
|
||||
public function index(CalculationDataTable $calculationDataTable)
|
||||
{
|
||||
$hasilPembagi = DB::table('divider')
|
||||
->join('criteria', 'criteria.id', 'divider.criteria_id')
|
||||
->select('divider.*', 'criteria.criteria_name', 'criteria.code')
|
||||
->orderBy('criteria.id', 'asc')
|
||||
->get();
|
||||
|
||||
$matriksNormalisasi = CalculationRepository::getMatrixNormalization();
|
||||
|
||||
$bobotTernormalisasi = CalculationRepository::getWeightNormalization();
|
||||
|
||||
$idealPositif = CalculationRepository::getIdealPositif();
|
||||
$idealNegative = CalculationRepository::getIdealNegative();
|
||||
|
||||
$solusiIdealPositif = CalculationRepository::getSolusiIdealPositif();
|
||||
$solusiIdealNegative = CalculationRepository::getSolusiIdealNegative();
|
||||
|
||||
$hasilTopsis = CalculationRepository::getHasil();
|
||||
|
||||
return view('calculations.index', compact(
|
||||
'hasilPembagi',
|
||||
'matriksNormalisasi',
|
||||
'bobotTernormalisasi',
|
||||
'idealPositif',
|
||||
'idealNegative',
|
||||
'solusiIdealPositif',
|
||||
'solusiIdealNegative',
|
||||
'hasilTopsis'
|
||||
));
|
||||
}
|
||||
|
||||
public function calcTopsis()
|
||||
{
|
||||
// hitung hasil pembagi/matrik keputusan
|
||||
CalculationRepository::calcDivider();
|
||||
|
||||
// hitung matriks ternormalisasi
|
||||
CalculationRepository::caclMatrixNormalization();
|
||||
|
||||
// hitung normalisasi terbobot
|
||||
CalculationRepository::calcWeightNormalization();
|
||||
|
||||
// hitung ideal positif
|
||||
// CalculationRepository::calcIdeal();
|
||||
|
||||
// hitung solysi ideal
|
||||
CalculationRepository::calcIdealPositif();
|
||||
CalculationRepository::calcIdealNegatif();
|
||||
CalculationRepository::calcIdealSolution();
|
||||
|
||||
// hitung hasil
|
||||
CalculationRepository::calcHasil();
|
||||
|
||||
Flash::success('Perhitungan berhasil.');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Calculation.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('calculations.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Calculation in storage.
|
||||
*/
|
||||
public function store(CreateCalculationRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$calculation = $this->calculationRepository->create($input);
|
||||
|
||||
Flash::success('Calculation saved successfully.');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Calculation.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$calculation = $this->calculationRepository->find($id);
|
||||
|
||||
if (empty($calculation)) {
|
||||
Flash::error('Calculation not found');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
return view('calculations.show')->with('calculation', $calculation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Calculation.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$calculation = $this->calculationRepository->find($id);
|
||||
|
||||
if (empty($calculation)) {
|
||||
Flash::error('Calculation not found');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
return view('calculations.edit')->with('calculation', $calculation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Calculation in storage.
|
||||
*/
|
||||
public function update($id, UpdateCalculationRequest $request)
|
||||
{
|
||||
$calculation = $this->calculationRepository->find($id);
|
||||
|
||||
if (empty($calculation)) {
|
||||
Flash::error('Calculation not found');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
$calculation = $this->calculationRepository->update($request->all(), $id);
|
||||
|
||||
Flash::success('Calculation updated successfully.');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Calculation from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$calculation = $this->calculationRepository->find($id);
|
||||
|
||||
if (empty($calculation)) {
|
||||
Flash::error('Calculation not found');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
$this->calculationRepository->delete($id);
|
||||
|
||||
Flash::success('Calculation deleted successfully.');
|
||||
|
||||
return redirect(route('calculations.index'));
|
||||
}
|
||||
|
||||
public function show_result()
|
||||
{
|
||||
\DB::statement("SET SQL_MODE=''");
|
||||
|
||||
$hasilTopsis = ResultTopsis::query();
|
||||
$hasilTopsis = $hasilTopsis
|
||||
->select(
|
||||
'result_topsis.*',
|
||||
'objeks.id as objek_id',
|
||||
'objeks.name',
|
||||
'objeks.code',
|
||||
'objeks.thumbnail'
|
||||
)
|
||||
->leftJoin('alternative', 'alternative.id', 'result_topsis.alternative_id')
|
||||
->leftJoin('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->leftJoin('analysis', 'alternative.id', 'analysis.alternative_id')
|
||||
->orderBy('result_topsis.nilai', 'DESC')
|
||||
->groupBy('result_topsis.alternative_id')
|
||||
->get();
|
||||
|
||||
return view('result.index', compact(
|
||||
'hasilTopsis'
|
||||
));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?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;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\DataTables\CriteriaDataTable;
|
||||
use App\Http\Requests\CreateCriteriaRequest;
|
||||
use App\Http\Requests\UpdateCriteriaRequest;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Models\Criteria;
|
||||
use App\Repositories\CriteriaRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use Flash;
|
||||
|
||||
class CriteriaController extends AppBaseController
|
||||
{
|
||||
/** @var CriteriaRepository $criteriaRepository*/
|
||||
private $criteriaRepository;
|
||||
|
||||
public function __construct(CriteriaRepository $criteriaRepo)
|
||||
{
|
||||
$this->criteriaRepository = $criteriaRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Criteria.
|
||||
*/
|
||||
public function index(CriteriaDataTable $criteriaDataTable)
|
||||
{
|
||||
return $criteriaDataTable->render('criterias.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Criteria.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$status = Criteria::$status;
|
||||
|
||||
return view('criterias.create', compact('status'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Criteria in storage.
|
||||
*/
|
||||
public function store(CreateCriteriaRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$criteria = $this->criteriaRepository->create($input);
|
||||
|
||||
Flash::success('Criteria saved successfully.');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Criteria.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$criteria = $this->criteriaRepository->find($id);
|
||||
|
||||
if (empty($criteria)) {
|
||||
Flash::error('Criteria not found');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
return view('criterias.show')->with('criteria', $criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Criteria.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$criteria = $this->criteriaRepository->find($id);
|
||||
|
||||
if (empty($criteria)) {
|
||||
Flash::error('Criteria not found');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
$status = Criteria::$status;
|
||||
|
||||
return view('criterias.edit', compact('status'))->with('criteria', $criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Criteria in storage.
|
||||
*/
|
||||
public function update($id, UpdateCriteriaRequest $request)
|
||||
{
|
||||
$criteria = $this->criteriaRepository->find($id);
|
||||
|
||||
if (empty($criteria)) {
|
||||
Flash::error('Criteria not found');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
$criteria = $this->criteriaRepository->update($request->all(), $id);
|
||||
|
||||
Flash::success('Criteria updated successfully.');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Criteria from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$criteria = $this->criteriaRepository->find($id);
|
||||
|
||||
if (empty($criteria)) {
|
||||
Flash::error('Criteria not found');
|
||||
|
||||
return redirect(route('criterias.index'));
|
||||
}
|
||||
|
||||
$this->criteriaRepository->delete($id);
|
||||
|
||||
return $this->sendSuccess('Data berhasil dihapus.');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,190 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Frontend;
|
||||
|
||||
use App\Models\Objek;
|
||||
use App\Models\Criteria;
|
||||
use Flash;
|
||||
use App\Models\SubCriteria;
|
||||
use App\Models\ObjekGallery;
|
||||
use App\Models\ResultTopsis;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\CalculationRepository;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
\DB::statement("SET SQL_MODE=''");
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
if (count($input) < 2 && count($input) >= 1) {
|
||||
$countInput = count($request->all());
|
||||
|
||||
|
||||
if ($countInput < 2) {
|
||||
return redirect()->route('wisata.index');
|
||||
}
|
||||
}
|
||||
|
||||
$data_criteria = Criteria::get();
|
||||
|
||||
$criteria = $data_criteria->map(function ($q) {
|
||||
$sub = SubCriteria::where('criteria_id', $q->id)->get();
|
||||
|
||||
return [
|
||||
'id' => $q->id,
|
||||
'code' => $q->code,
|
||||
'criteria_name' => $q->criteria_name,
|
||||
'status' => $q->status,
|
||||
'value' => $q->value,
|
||||
'sub' => $sub,
|
||||
];
|
||||
});
|
||||
|
||||
// Lakukan filter berdasarkan kriteria yang dipilih
|
||||
$filteredResults = ResultTopsis::query();
|
||||
$filteredResults = $filteredResults
|
||||
->select(
|
||||
'result_topsis.*',
|
||||
'objeks.id as objek_id',
|
||||
'objeks.name',
|
||||
'objeks.thumbnail'
|
||||
)
|
||||
->leftJoin('alternative', 'alternative.id', 'result_topsis.alternative_id')
|
||||
->leftJoin('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->leftJoin('analysis', 'alternative.id', 'analysis.alternative_id');
|
||||
|
||||
// Filter berdasarkan kriteria yang dipilih
|
||||
if ($request->filled('harga')) {
|
||||
$filteredResults->orWhere('analysis.sub_criteria_id', '=', $request->harga);
|
||||
}
|
||||
|
||||
if ($request->filled('jarak')) {
|
||||
$filteredResults->orWhere('analysis.sub_criteria_id', '=', $request->jarak);
|
||||
}
|
||||
|
||||
if ($request->filled('akses')) {
|
||||
$filteredResults->orWhere('analysis.sub_criteria_id', '=', $request->akses);
|
||||
}
|
||||
|
||||
if ($request->filled('fasilitas')) {
|
||||
$filteredResults->orWhere('analysis.sub_criteria_id', '=', $request->fasilitas);
|
||||
}
|
||||
|
||||
$filteredResults = $filteredResults->orderBy('result_topsis.nilai', 'DESC')
|
||||
->groupBy('result_topsis.alternative_id')
|
||||
->get()
|
||||
->take(6);
|
||||
|
||||
$objek = Objek::get();
|
||||
// dd($objek);
|
||||
|
||||
$hasilPembagi = DB::table('divider')
|
||||
->join('criteria', 'criteria.id', 'divider.criteria_id')
|
||||
->select('divider.*', 'criteria.criteria_name', 'criteria.code')
|
||||
->orderBy('criteria.id', 'asc')
|
||||
->get();
|
||||
|
||||
$matriksNormalisasi = CalculationRepository::getMatrixNormalization();
|
||||
|
||||
$bobotTernormalisasi = CalculationRepository::getWeightNormalization();
|
||||
|
||||
$idealPositif = CalculationRepository::getIdealPositif();
|
||||
$idealNegative = CalculationRepository::getIdealNegative();
|
||||
|
||||
$solusiIdealPositif = CalculationRepository::getSolusiIdealPositif();
|
||||
$solusiIdealNegative = CalculationRepository::getSolusiIdealNegative();
|
||||
|
||||
$hasilTopsis = CalculationRepository::getHasil()->sortByDesc('nilai');
|
||||
|
||||
return view('frontend.home', compact(
|
||||
'criteria',
|
||||
'objek',
|
||||
'hasilPembagi',
|
||||
'matriksNormalisasi',
|
||||
'bobotTernormalisasi',
|
||||
'idealPositif',
|
||||
'idealNegative',
|
||||
'solusiIdealPositif',
|
||||
'solusiIdealNegative',
|
||||
'hasilTopsis'), ['recomendation' => $filteredResults]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$objek = Objek::find($id);
|
||||
$gallery = ObjekGallery::where('objek_id', $id)->get();
|
||||
|
||||
return view('frontend.detail', compact('objek', 'gallery'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
// public function __construct()
|
||||
// {
|
||||
// $this->middleware('auth');
|
||||
// }
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\DataTables\ObjekDataTable;
|
||||
use App\Http\Requests\CreateObjekRequest;
|
||||
use App\Http\Requests\UpdateObjekRequest;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Repositories\ObjekRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use Flash;
|
||||
|
||||
class ObjekController extends AppBaseController
|
||||
{
|
||||
/** @var ObjekRepository $objekRepository*/
|
||||
private $objekRepository;
|
||||
|
||||
public function __construct(ObjekRepository $objekRepo)
|
||||
{
|
||||
$this->objekRepository = $objekRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the Objek.
|
||||
*/
|
||||
public function index(ObjekDataTable $objekDataTable)
|
||||
{
|
||||
return $objekDataTable->render('objeks.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new Objek.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('objeks.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created Objek in storage.
|
||||
*/
|
||||
public function store(CreateObjekRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
if ($request->hasFile('thumbnail')) {
|
||||
$extension = $request->file('thumbnail')->getClientOriginalExtension();
|
||||
$filenameSimpan = 'thumbnail' . '_' . time() . '.' . $extension;
|
||||
|
||||
$request->file('thumbnail')->move(public_path().'/media/', $filenameSimpan);
|
||||
$input['thumbnail'] = $filenameSimpan;
|
||||
}
|
||||
|
||||
$objek = $this->objekRepository->create($input);
|
||||
|
||||
Flash::success('Objek saved successfully.');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified Objek.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$objek = $this->objekRepository->find($id);
|
||||
|
||||
if (empty($objek)) {
|
||||
Flash::error('Objek not found');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
return view('objeks.show')->with('objek', $objek);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified Objek.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$objek = $this->objekRepository->find($id);
|
||||
|
||||
if (empty($objek)) {
|
||||
Flash::error('Objek not found');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
return view('objeks.edit')->with('objek', $objek);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified Objek in storage.
|
||||
*/
|
||||
public function update($id, UpdateObjekRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$objek = $this->objekRepository->find($id);
|
||||
|
||||
if (empty($objek)) {
|
||||
Flash::error('Objek not found');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
if ($request->hasFile('thumbnail')) {
|
||||
$extension = $request->file('thumbnail')->getClientOriginalExtension();
|
||||
$filenameSimpan = 'thumbnail' . '_' . time() . '.' . $extension;
|
||||
|
||||
$request->file('thumbnail')->move(public_path().'/media/', $filenameSimpan);
|
||||
$input['thumbnail'] = $filenameSimpan;
|
||||
}
|
||||
|
||||
$objek = $this->objekRepository->update($input, $id);
|
||||
|
||||
Flash::success('Objek updated successfully.');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified Objek from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$objek = $this->objekRepository->find($id);
|
||||
|
||||
if (empty($objek)) {
|
||||
Flash::error('Objek not found');
|
||||
|
||||
return redirect(route('objeks.index'));
|
||||
}
|
||||
|
||||
$this->objekRepository->delete($id);
|
||||
|
||||
return $this->sendSuccess('Data berhasil dihapus.');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Objek;
|
||||
use Laracasts\Flash\Flash;
|
||||
use App\Models\ObjekGallery;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ObjekGalleryController extends AppBaseController
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
if ($request->hasFile('image')) {
|
||||
$extension = $request->file('image')->getClientOriginalExtension();
|
||||
$filenameSimpan = 'image' . '_' . time() . '.' . $extension;
|
||||
|
||||
$request->file('image')->move(public_path().'/media/', $filenameSimpan);
|
||||
$input['image'] = $filenameSimpan;
|
||||
}
|
||||
|
||||
$objek_gallery = ObjekGallery::create([
|
||||
'objek_id' => $input['objek_id'],
|
||||
'title' => $input['title'],
|
||||
'image' => $filenameSimpan,
|
||||
]);
|
||||
|
||||
Flash::success('Image saved successfully.');
|
||||
|
||||
return redirect(route('objekGallery.edit', $request->objek_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$objek = Objek::find($id);
|
||||
$gallery = ObjekGallery::where('objek_id', $id)->get();
|
||||
|
||||
return view('objek_gallery.index', compact('objek','gallery'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$gallery = ObjekGallery::find($id)->delete();
|
||||
|
||||
return $this->sendSuccess('Data berhasil dihapus.');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,147 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\DataTables\SubCriteriaDataTable;
|
||||
use App\Http\Requests\CreateSubCriteriaRequest;
|
||||
use App\Http\Requests\UpdateSubCriteriaRequest;
|
||||
use App\Http\Controllers\AppBaseController;
|
||||
use App\Models\Criteria;
|
||||
use App\Models\SubCriteria;
|
||||
use App\Repositories\SubCriteriaRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use Flash;
|
||||
|
||||
class SubCriteriaController extends AppBaseController
|
||||
{
|
||||
/** @var SubCriteriaRepository $subCriteriaRepository*/
|
||||
private $subCriteriaRepository;
|
||||
|
||||
public function __construct(SubCriteriaRepository $subCriteriaRepo)
|
||||
{
|
||||
$this->subCriteriaRepository = $subCriteriaRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the SubCriteria.
|
||||
*/
|
||||
public function index(SubCriteriaDataTable $subCriteriaDataTable)
|
||||
{
|
||||
return $subCriteriaDataTable->render('sub_criterias.index');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show the form for creating a new SubCriteria.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$criteria = Criteria::all()->pluck('criteria_name', 'id')->toArray();
|
||||
|
||||
return view('sub_criterias.create', compact('criteria'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created SubCriteria in storage.
|
||||
*/
|
||||
public function store(CreateSubCriteriaRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$subCriteria = $this->subCriteriaRepository->create($input);
|
||||
|
||||
$countSub = SubCriteria::where('criteria_id', $request->criteria_id)->count();
|
||||
$updateCriteria = Criteria::where('id', $request->criteria_id)
|
||||
->update([
|
||||
'value' => $countSub
|
||||
]);
|
||||
|
||||
Flash::success('Sub Criteria saved successfully.');
|
||||
|
||||
return redirect(route('subCriterias.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified SubCriteria.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$subCriteria = $this->subCriteriaRepository->find($id);
|
||||
|
||||
if (empty($subCriteria)) {
|
||||
Flash::error('Sub Criteria not found');
|
||||
|
||||
return redirect(route('subCriterias.index'));
|
||||
}
|
||||
|
||||
return view('sub_criterias.show')->with('subCriteria', $subCriteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified SubCriteria.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$criteria = Criteria::find($id);
|
||||
|
||||
if (empty($criteria)) {
|
||||
Flash::error('Data not found');
|
||||
|
||||
return redirect(route('subCriterias.index'));
|
||||
}
|
||||
|
||||
$sub_criteria = SubCriteria::where('criteria_id', $id)->get();
|
||||
|
||||
return view('sub_criterias.edit', compact('sub_criteria'))->with('criteria', $criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified SubCriteria in storage.
|
||||
*/
|
||||
public function update($id, UpdateSubCriteriaRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
if (count($input['id']) > 0) {
|
||||
// loop data berdasarkan id
|
||||
foreach ($input['id'] as $key => $item) {
|
||||
// update data
|
||||
$data = SubCriteria::where('id', $item)
|
||||
->update([
|
||||
'description' => $input['description'][$key],
|
||||
'value' => $input['value'][$key],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$countSub = SubCriteria::where('criteria_id', $request->criteria_id)->count();
|
||||
$updateCriteria = Criteria::where('id', $request->criteria_id)
|
||||
->update([
|
||||
'value' => $countSub
|
||||
]);
|
||||
|
||||
Flash::success('Sub Criteria updated successfully.');
|
||||
|
||||
return redirect(route('subCriterias.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified SubCriteria from storage.
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$subCriteria = $this->subCriteriaRepository->find($id);
|
||||
|
||||
if (empty($subCriteria)) {
|
||||
Flash::error('Sub Criteria not found');
|
||||
|
||||
return redirect(route('subCriterias.index'));
|
||||
}
|
||||
|
||||
$this->subCriteriaRepository->delete($id);
|
||||
|
||||
return $this->sendSuccess('Data berhasil dihapus.');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Laracasts\Flash\Flash;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$user = auth()->user();
|
||||
|
||||
return view('profiles.index', compact('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
$auth = auth()->user();
|
||||
$input = $request->all();
|
||||
|
||||
$user = User::find($auth->id);
|
||||
|
||||
if ($request->hasFile('photo')) {
|
||||
$extension = $request->file('photo')->getClientOriginalExtension();
|
||||
$filenameSimpan = 'profile' . '_' . time() . '.' . $extension;
|
||||
|
||||
$request->file('photo')->move(public_path().'/media/', $filenameSimpan);
|
||||
$input['photo'] = $filenameSimpan;
|
||||
}
|
||||
|
||||
$user->update($input);
|
||||
|
||||
Flash::success('Data updated successfully.');
|
||||
|
||||
return redirect(route('user'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
<?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<int, class-string|string>
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Illuminate\Http\Middleware\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<string, array<int, class-string|string>>
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::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<string, class-string|string>
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::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' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::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,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<int, string>
|
||||
*/
|
||||
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<int, string>
|
||||
*/
|
||||
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(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @param string|null ...$guards
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
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<int, string>
|
||||
*/
|
||||
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<int, string|null>
|
||||
*/
|
||||
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<int, string>|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,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
|
||||
|
||||
class ValidateSignature extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the query string parameters that should be ignored.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
// 'fbclid',
|
||||
// 'utm_campaign',
|
||||
// 'utm_content',
|
||||
// 'utm_medium',
|
||||
// 'utm_source',
|
||||
// 'utm_term',
|
||||
];
|
||||
}
|
|
@ -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<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateAlternativeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Alternative::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Analysis;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateAnalysisRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Analysis::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Calculation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateCalculationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Calculation::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateCriteriaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Criteria::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Objek;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateObjekRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return Objek::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\SubCriteria;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CreateSubCriteriaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return SubCriteria::$rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateAlternativeRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = Alternative::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Analysis;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateAnalysisRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = Analysis::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Calculation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCalculationRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = Calculation::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateCriteriaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = Criteria::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\Objek;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateObjekRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = Objek::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Models\SubCriteria;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateSubCriteriaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
$rules = SubCriteria::$rules;
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Alternative extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'alternative';
|
||||
protected $primaryKey = "id";
|
||||
public $incrementing = "true";
|
||||
|
||||
public $fillable = [
|
||||
'objek_id'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'objek_id' => 'string'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'objek_id' => 'nullable'
|
||||
];
|
||||
|
||||
public function objek()
|
||||
{
|
||||
return $this->belongsTo(Objek::class, 'objek_id', 'id');
|
||||
}
|
||||
|
||||
public function analysis()
|
||||
{
|
||||
return $this->hasMany(Analysis::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use App\Models\Alternative;
|
||||
use App\Models\SubCriteria;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class Analysis extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'analysis';
|
||||
protected $primaryKey = "id";
|
||||
|
||||
public $fillable = [
|
||||
'alternative_id',
|
||||
'criteria_id',
|
||||
'sub_criteria_id'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'alternative_id' => 'integer',
|
||||
'criteria_id' => 'integer',
|
||||
'sub_criteria_id' => 'integer'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'alternative_id' => 'nullable',
|
||||
'criteria_id' => 'nullable',
|
||||
'sub_criteria_id' => 'nullable'
|
||||
];
|
||||
|
||||
public function alternatif()
|
||||
{
|
||||
return $this->belongsTo(Alternative::class, 'alternative_id', 'id');
|
||||
}
|
||||
|
||||
public function kriteria()
|
||||
{
|
||||
return $this->belongsTo(Criteria::class, 'criteria_id', 'id');
|
||||
}
|
||||
|
||||
public function subKriteria()
|
||||
{
|
||||
return $this->belongsTo(SubCriteria::class, 'sub_criteria_id', 'id');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Calculation extends Model
|
||||
{
|
||||
public $table = 'calculations';
|
||||
|
||||
public $fillable = [
|
||||
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
];
|
||||
|
||||
public static array $rules = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Criteria extends Model
|
||||
{
|
||||
public $table = 'criteria';
|
||||
protected $primaryKey = "id";
|
||||
public $incrementing = "true";
|
||||
|
||||
public $fillable = [
|
||||
'code',
|
||||
'criteria_name',
|
||||
'status',
|
||||
'value'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'code' => 'string',
|
||||
'criteria_name' => 'string',
|
||||
'status' => 'integer'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'code' => 'nullable',
|
||||
'criteria_name' => 'nullable',
|
||||
'status' => 'nullable'
|
||||
];
|
||||
|
||||
public static $status = [
|
||||
'0' => 'Benefit',
|
||||
'1' => 'Cost'
|
||||
];
|
||||
|
||||
public function subKriteria()
|
||||
{
|
||||
return $this->hasMany(SubCriteria::class);
|
||||
}
|
||||
|
||||
public function analysis()
|
||||
{
|
||||
return $this->hasMany(Analysis::class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Divider extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'divider';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'criteria_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IdealNegative extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'ideal_negatif';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id',
|
||||
'criteria_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IdealNegativeSolution extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'ideal_negative_solution';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IdealPositif extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'ideal_positif';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id',
|
||||
'criteria_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class IdealPositiveSolution extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'ideal_positif_solution';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class MatrixNormalization extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'matrix_normalization';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id',
|
||||
'criteria_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Objek extends Model
|
||||
{
|
||||
public $table = 'objeks';
|
||||
|
||||
public $fillable = [
|
||||
'code',
|
||||
'name',
|
||||
'thumbnail',
|
||||
'description',
|
||||
'price',
|
||||
'address'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'code' => 'string',
|
||||
'name' => 'string'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'code' => 'nullable',
|
||||
'name' => 'nullable'
|
||||
];
|
||||
|
||||
public function alternatif()
|
||||
{
|
||||
return $this->hasMany(Alternative::class);
|
||||
}
|
||||
|
||||
public function gallery()
|
||||
{
|
||||
return $this->hasMany(ObjekGallery::class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ObjekGallery extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'objek_gallery';
|
||||
|
||||
public $fillable = [
|
||||
'objek_id',
|
||||
'title',
|
||||
'image'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'title' => 'string',
|
||||
'image' => 'string'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'title' => 'nullable',
|
||||
'image' => 'nullable'
|
||||
];
|
||||
|
||||
public function objek()
|
||||
{
|
||||
return $this->belongsTo(Objek::class, 'objek_id', 'id');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ResultTopsis extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'result_topsis';
|
||||
|
||||
public $fillable = [
|
||||
'nilai',
|
||||
'alternative_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SubCriteria extends Model
|
||||
{
|
||||
public $table = 'sub_criteria';
|
||||
protected $primaryKey = "id";
|
||||
public $incrementing = "true";
|
||||
|
||||
public $fillable = [
|
||||
'criteria_id',
|
||||
'description',
|
||||
'value'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'criteria_id' => 'integer',
|
||||
'description' => 'string',
|
||||
'value' => 'double'
|
||||
];
|
||||
|
||||
public static $rules = [
|
||||
'criteria_id' => 'nullable',
|
||||
'description' => 'nullable',
|
||||
'value' => 'nullable'
|
||||
];
|
||||
|
||||
public function kriteria()
|
||||
{
|
||||
return $this->belongsTo(Criteria::class, 'criteria_id', 'id');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens, HasFactory, Notifiable, HasRoles;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'photo'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'remember_token',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class WeightNormalization extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public $table = 'wight_normalization';
|
||||
|
||||
public $fillable = [
|
||||
'value',
|
||||
'alternative_id',
|
||||
'criteria_id'
|
||||
];
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
if (env('APP_ENV') != 'local') {
|
||||
$this->app['request']->server->set('HTTPS', true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
if (env('APP_ENV') != 'local') {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The model to policy mappings for the application.
|
||||
*
|
||||
* @var array<class-string, class-string>
|
||||
*/
|
||||
protected $policies = [
|
||||
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$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,42 @@
|
|||
<?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 to listener mappings for the application.
|
||||
*
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldDiscoverEvents()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
<?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.
|
||||
*
|
||||
* Typically, users are redirected here after authentication.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/dashboard';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->configureRateLimiting();
|
||||
|
||||
$this->routes(function () {
|
||||
Route::middleware('api')
|
||||
->prefix('api')
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->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($request->user()?->id ?: $request->ip());
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Alternative;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class AlternativeRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
'code',
|
||||
'name'
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return Alternative::class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Analysis;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class AnalysisRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
'alternative_id',
|
||||
'criteria_id',
|
||||
'sub_criteria_id'
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return Analysis::class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use Illuminate\Container\Container as Application;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
abstract class BaseRepository
|
||||
{
|
||||
/**
|
||||
* @var Model
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->makeModel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get searchable fields array
|
||||
*/
|
||||
abstract public function getFieldsSearchable(): array;
|
||||
|
||||
/**
|
||||
* Configure the Model
|
||||
*/
|
||||
abstract public function model(): string;
|
||||
|
||||
/**
|
||||
* Make Model instance
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @return Model
|
||||
*/
|
||||
public function makeModel()
|
||||
{
|
||||
$model = app($this->model());
|
||||
|
||||
if (!$model instanceof Model) {
|
||||
throw new \Exception("Class {$this->model()} must be an instance of Illuminate\\Database\\Eloquent\\Model");
|
||||
}
|
||||
|
||||
return $this->model = $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paginate records for scaffold.
|
||||
*/
|
||||
public function paginate(int $perPage, array $columns = ['*']): LengthAwarePaginator
|
||||
{
|
||||
$query = $this->allQuery();
|
||||
|
||||
return $query->paginate($perPage, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a query for retrieving all records.
|
||||
*/
|
||||
public function allQuery(array $search = [], int $skip = null, int $limit = null): Builder
|
||||
{
|
||||
$query = $this->model->newQuery();
|
||||
|
||||
if (count($search)) {
|
||||
foreach($search as $key => $value) {
|
||||
if (in_array($key, $this->getFieldsSearchable())) {
|
||||
$query->where($key, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_null($skip)) {
|
||||
$query->skip($skip);
|
||||
}
|
||||
|
||||
if (!is_null($limit)) {
|
||||
$query->limit($limit);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve all records with given filter criteria
|
||||
*/
|
||||
public function all(array $search = [], int $skip = null, int $limit = null, array $columns = ['*']): Collection
|
||||
{
|
||||
$query = $this->allQuery($search, $skip, $limit);
|
||||
|
||||
return $query->get($columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create model record
|
||||
*/
|
||||
public function create(array $input): Model
|
||||
{
|
||||
$model = $this->model->newInstance($input);
|
||||
|
||||
$model->save();
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find model record for given id
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|Model|null
|
||||
*/
|
||||
public function find(int $id, array $columns = ['*'])
|
||||
{
|
||||
$query = $this->model->newQuery();
|
||||
|
||||
return $query->find($id, $columns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update model record for given id
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|Model
|
||||
*/
|
||||
public function update(array $input, int $id)
|
||||
{
|
||||
$query = $this->model->newQuery();
|
||||
|
||||
$model = $query->findOrFail($id);
|
||||
|
||||
$model->fill($input);
|
||||
|
||||
$model->save();
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*
|
||||
* @return bool|mixed|null
|
||||
*/
|
||||
public function delete(int $id)
|
||||
{
|
||||
$query = $this->model->newQuery();
|
||||
|
||||
$model = $query->findOrFail($id);
|
||||
|
||||
return $model->delete();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,354 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Divider;
|
||||
use App\Models\Analysis;
|
||||
use App\Models\Criteria;
|
||||
use App\Models\Calculation;
|
||||
use App\Models\IdealNegative;
|
||||
use App\Models\IdealNegativeSolution;
|
||||
use App\Models\IdealPositif;
|
||||
use App\Models\IdealPositiveSolution;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Models\MatrixNormalization;
|
||||
use App\Models\ResultTopsis;
|
||||
use App\Models\WeightNormalization;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class CalculationRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return Calculation::class;
|
||||
}
|
||||
|
||||
public static function calcDivider()
|
||||
{
|
||||
// hitung hasil pembagi/matrik keputusan
|
||||
$analysis = Analysis::with('alternatif', 'kriteria', 'subKriteria')->orderBy('id', 'asc')->get();
|
||||
foreach ($analysis->unique('criteria_id') as $item) {
|
||||
$penilaianKriteria = $analysis->where('criteria_id', $item->criteria_id);
|
||||
$hitung = 0;
|
||||
|
||||
foreach ($penilaianKriteria as $value) {
|
||||
if ($value->sub_criteria_id == null) {
|
||||
abort(403, "Masukkan nilai alternatif ". $value->alternatif->objek->name ."!");
|
||||
}
|
||||
$hitung += pow($value->subKriteria->value, 2);
|
||||
}
|
||||
|
||||
$hitung = sqrt($hitung);
|
||||
|
||||
// simpan
|
||||
$simpan = Divider::updateOrCreate(
|
||||
['criteria_id' => $item->criteria_id],
|
||||
['value' => $hitung]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getMatrixNormalization()
|
||||
{
|
||||
$data = MatrixNormalization::join('criteria', 'criteria.id', 'matrix_normalization.criteria_id')
|
||||
->join('alternative', 'alternative.id', 'matrix_normalization.alternative_id')
|
||||
->join('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select(
|
||||
'matrix_normalization.*',
|
||||
'criteria.criteria_name',
|
||||
'criteria.code',
|
||||
'objeks.name',
|
||||
'objeks.code as c',
|
||||
)
|
||||
->orderBy('alternative.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function caclMatrixNormalization()
|
||||
{
|
||||
$analysis = Analysis::with('alternatif', 'kriteria', 'subKriteria')->orderBy('id', 'asc')->get();
|
||||
|
||||
foreach ($analysis->unique('criteria_id') as $item) {
|
||||
$penilaianKriteria = $analysis->where('criteria_id', $item->criteria_id);
|
||||
$pembagi = Divider::where('criteria_id', $item->criteria_id)->first();
|
||||
|
||||
foreach ($penilaianKriteria as $value) {
|
||||
$matriksNormalisasi = $value->subKriteria->value / $pembagi->value;
|
||||
|
||||
// simpan
|
||||
$simpan = MatrixNormalization::updateOrCreate(
|
||||
['criteria_id' => $value->criteria_id, 'alternative_id' => $value->alternative_id],
|
||||
['value' => $matriksNormalisasi]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function calcWeightNormalization()
|
||||
{
|
||||
$matriksNormalisasi = self::getMatrixNormalization();
|
||||
foreach ($matriksNormalisasi->unique('criteria_id') as $item) {
|
||||
$matriksNormalisasiKriteria = $matriksNormalisasi->where('criteria_id', $item->criteria_id);
|
||||
$bobotKriteria = Criteria::where('id', $item->criteria_id)->firstOrFail();
|
||||
|
||||
foreach ($matriksNormalisasiKriteria as $value) {
|
||||
$normalisasi_terbobot = $value->value * $bobotKriteria->value;
|
||||
$result_normalisasi_terbobot = round($normalisasi_terbobot, 3);
|
||||
|
||||
// simpan
|
||||
$simpan = WeightNormalization::updateOrCreate(
|
||||
['criteria_id' => $value->criteria_id, 'alternative_id' => $value->alternative_id],
|
||||
['value' => $result_normalisasi_terbobot]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getWeightNormalization()
|
||||
{
|
||||
$data = WeightNormalization::join('criteria', 'criteria.id', 'wight_normalization.criteria_id')
|
||||
->join('alternative', 'alternative.id', 'wight_normalization.alternative_id')
|
||||
->join('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select('wight_normalization.*', 'criteria.criteria_name', 'criteria.code', 'objeks.name', 'objeks.code as c')
|
||||
->orderBy('alternative.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getIdealPositif()
|
||||
{
|
||||
$data = DB::table('ideal_positif as ip')
|
||||
->join('criteria as k', 'k.id', 'ip.criteria_id')
|
||||
->join('alternative as a', 'a.id', 'ip.alternative_id')
|
||||
->join('objeks as o', 'o.id', 'a.objek_id')
|
||||
->select('ip.*', 'k.criteria_name', 'k.code', 'o.name', 'o.code as c')
|
||||
->orderBy('ip.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function calcIdealPositif()
|
||||
{
|
||||
$bobotNormalisasi = self::getWeightNormalization();
|
||||
|
||||
foreach ($bobotNormalisasi->unique('criteria_id') as $key => $item) {
|
||||
$dataBobotNormalisasi = $bobotNormalisasi->where('criteria_id', $item->criteria_id);
|
||||
|
||||
$solusiIdealY = [];
|
||||
foreach ($dataBobotNormalisasi as $key => $value) {
|
||||
$solusiIdealY[] = $value->value;
|
||||
}
|
||||
|
||||
$Ymax = ['value' => min($solusiIdealY), 'criteria_id' => $item->criteria_id];
|
||||
|
||||
foreach ($dataBobotNormalisasi as $val) {
|
||||
$idealPositif = pow(($val->value - $Ymax['value']), 2);
|
||||
$resultIdealPositif = $idealPositif;
|
||||
$simpan = IdealPositif::updateOrCreate(
|
||||
['criteria_id' => $val->criteria_id, 'alternative_id' => $val->alternative_id],
|
||||
['value' => $resultIdealPositif]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function calcIdealNegatif()
|
||||
{
|
||||
$bobotNormalisasi = self::getWeightNormalization();
|
||||
|
||||
foreach ($bobotNormalisasi->unique('criteria_id') as $key => $item) {
|
||||
$dataBobotNormalisasi = $bobotNormalisasi->where('criteria_id', $item->criteria_id);
|
||||
|
||||
$solusiIdealY = [];
|
||||
foreach ($dataBobotNormalisasi as $key => $value) {
|
||||
$solusiIdealY[] = $value->value;
|
||||
}
|
||||
|
||||
$Ymin = ['value' => max($solusiIdealY), 'criteria_id' => $item->criteria_id];
|
||||
|
||||
foreach ($dataBobotNormalisasi as $val) {
|
||||
$idealPositif = pow(($val->value - $Ymin['value']), 2);
|
||||
$resultIdealPositif = $idealPositif;
|
||||
$simpan = IdealNegative::updateOrCreate(
|
||||
['criteria_id' => $val->criteria_id, 'alternative_id' => $val->alternative_id],
|
||||
['value' => $resultIdealPositif]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getIdealNegative()
|
||||
{
|
||||
$data = DB::table('ideal_negatif as in')
|
||||
->join('criteria as k', 'k.id', 'in.criteria_id')
|
||||
->join('alternative as a', 'a.id', 'in.alternative_id')
|
||||
->join('objeks as o', 'o.id', 'a.objek_id')
|
||||
->select('in.*', 'k.criteria_name', 'k.code', 'o.name', 'o.code as c')
|
||||
->orderBy('in.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function calcIdeal()
|
||||
{
|
||||
// ambil data bobot ternormalisasi
|
||||
$bobotNormalisasi = self::getWeightNormalization();
|
||||
|
||||
// loop data bobot ternormalisasi berdasarkan criteria
|
||||
foreach ($bobotNormalisasi->unique('criteria_id') as $item) {
|
||||
// ambil data bobot ternormalisasi yang criteria_id nya sesuai
|
||||
$dataBobotNormalisasi = $bobotNormalisasi->where('criteria_id', $item->criteria_id);
|
||||
|
||||
// lakukan looping dan tampung hasilnya dalam array
|
||||
$solusiIdealY = [];
|
||||
foreach ($dataBobotNormalisasi as $value) {
|
||||
$solusiIdealY[] = $value->value;
|
||||
}
|
||||
|
||||
// cari min max berdasarkan cost benefit kriteria
|
||||
$solusiIdealPositif = ['value' => min($solusiIdealY), 'criteria_id' => $item->criteria_id];
|
||||
|
||||
$solusiIdealNegatif = ['value' => max($solusiIdealY), 'criteria_id' => $item->criteria_id];
|
||||
|
||||
// hitung matrik solusi ideal tiap kriteria
|
||||
foreach ($dataBobotNormalisasi as $value) {
|
||||
$idealPositif = pow(($value->value - $solusiIdealPositif['value']), 2);
|
||||
$simpan = IdealPositif::updateOrCreate(
|
||||
['criteria_id' => $value->criteria_id, 'alternative_id' => $value->alternative_id],
|
||||
['value' => $idealPositif]
|
||||
);
|
||||
|
||||
$idealNegatif = pow($value->value - $solusiIdealNegatif['value'], 2);
|
||||
$simpan = IdealNegative::updateOrCreate(
|
||||
['criteria_id' => $value->criteria_id, 'alternative_id' => $value->alternative_id],
|
||||
['value' => $idealNegatif]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function calcIdealSolution()
|
||||
{
|
||||
$idealPositif = self::getIdealPositif();
|
||||
$idealNegatif = self::getIdealNegative();
|
||||
|
||||
// hitung solusi ideal positif
|
||||
foreach ($idealPositif as $key => $item) {
|
||||
$idealPositifD = $idealPositif->where('alternative_id', $item->alternative_id);
|
||||
$positifD = 0;
|
||||
|
||||
foreach ($idealPositifD as $value) {
|
||||
$positifD += $value->value;
|
||||
}
|
||||
|
||||
$simpan = IdealPositiveSolution::updateOrCreate(
|
||||
['alternative_id' => $item->alternative_id],
|
||||
['value' => sqrt($positifD)]
|
||||
);
|
||||
}
|
||||
|
||||
// hitung solusi ideal negative
|
||||
foreach ($idealNegatif as $key => $item) {
|
||||
$idealNegatifD = $idealNegatif->where('alternative_id', $item->alternative_id);
|
||||
$negatifD = 0;
|
||||
|
||||
foreach ($idealNegatifD as $value) {
|
||||
$negatifD += $value->value;
|
||||
}
|
||||
|
||||
$simpan = IdealNegativeSolution::updateOrCreate(
|
||||
['alternative_id' => $item->alternative_id],
|
||||
['value' => sqrt($negatifD)]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// get solusi ideal
|
||||
public static function getSolusiIdealPositif()
|
||||
{
|
||||
$data = IdealPositiveSolution::join('alternative', 'alternative.id', 'ideal_positif_solution.alternative_id')
|
||||
->join('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select('ideal_positif_solution.*', 'objeks.name', 'objeks.code')
|
||||
->orderBy('ideal_positif_solution.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function getSolusiIdealNegative()
|
||||
{
|
||||
$data = IdealNegativeSolution::join('alternative', 'alternative.id', 'ideal_negative_solution.alternative_id')
|
||||
->join('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select('ideal_negative_solution.*', 'objeks.name', 'objeks.code')
|
||||
->orderBy('ideal_negative_solution.id', 'asc')
|
||||
->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function calcHasil()
|
||||
{
|
||||
$solusiIdealPositif = self::getSolusiIdealPositif();
|
||||
$solusiIdealNegatif = self::getSolusiIdealNegative();
|
||||
|
||||
$dataPositif = [];
|
||||
$dataNegatif = [];
|
||||
$hitung = [];
|
||||
|
||||
foreach ($solusiIdealPositif as $item) {
|
||||
$dataPositif[] = [
|
||||
'alternative_id' => $item->alternative_id,
|
||||
'value' => $item->value,
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($solusiIdealNegatif as $item) {
|
||||
$dataNegatif[] = [
|
||||
'alternative_id' => $item->alternative_id,
|
||||
'value' => $item->value,
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($dataPositif as $item) {
|
||||
foreach ($dataNegatif as $value) {
|
||||
if ($value['alternative_id'] == $item['alternative_id']) {
|
||||
$hitung = [
|
||||
'alternative_id' => $item['alternative_id'],
|
||||
'value' => $value['value'] / ($item['value'] + $value['value']),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$simpan = ResultTopsis::updateOrCreate(
|
||||
['alternative_id' => $item['alternative_id']],
|
||||
['nilai' => $hitung['value']]
|
||||
);
|
||||
|
||||
$hitung = [];
|
||||
}
|
||||
}
|
||||
|
||||
public static function getHasil()
|
||||
{
|
||||
$data = ResultTopsis::join('alternative', 'alternative.id', 'result_topsis.alternative_id')
|
||||
->join('objeks', 'objeks.id', 'alternative.objek_id')
|
||||
->select('result_topsis.*', 'objeks.name', 'objeks.code')
|
||||
->orderBy('result_topsis.id', 'asc')->get();
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Criteria;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class CriteriaRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
'code',
|
||||
'criteria_name',
|
||||
'status'
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return Criteria::class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Objek;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class ObjekRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
'name'
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return Objek::class;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\SubCriteria;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class SubCriteriaRepository extends BaseRepository
|
||||
{
|
||||
protected $fieldSearchable = [
|
||||
'criteria_id',
|
||||
'description',
|
||||
'value'
|
||||
];
|
||||
|
||||
public function getFieldsSearchable(): array
|
||||
{
|
||||
return $this->fieldSearchable;
|
||||
}
|
||||
|
||||
public function model(): string
|
||||
{
|
||||
return SubCriteria::class;
|
||||
}
|
||||
}
|
|
@ -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,74 @@
|
|||
{
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.0.2",
|
||||
"doctrine/dbal": "~2.3",
|
||||
"guzzlehttp/guzzle": "^7.2",
|
||||
"infyomlabs/adminlte-templates": "^5.0",
|
||||
"infyomlabs/laravel-generator": "^5.0",
|
||||
"infyomlabs/laravel-ui-adminlte": "^5.1",
|
||||
"laravel/framework": "^9.19",
|
||||
"laravel/sanctum": "^3.0",
|
||||
"laravel/tinker": "^2.7",
|
||||
"spatie/laravel-permission": "^6.4",
|
||||
"yajra/laravel-datatables": "9.0",
|
||||
"yajra/laravel-datatables-buttons": "9.0",
|
||||
"yajra/laravel-datatables-html": "9.0",
|
||||
"yajra/laravel-datatables-oracle": "10.3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/pint": "^1.0",
|
||||
"laravel/sail": "^1.0.1",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
"nunomaduro/collision": "^6.1",
|
||||
"phpunit/phpunit": "^9.5.10",
|
||||
"spatie/laravel-ignition": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"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 --force"
|
||||
],
|
||||
"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,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,223 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
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'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options determine the driver used to determine and
|
||||
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||
| allow maintenance mode to be controlled across multiple machines.
|
||||
|
|
||||
| Supported drivers: "file", "cache"
|
||||
|
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => 'file',
|
||||
// 'store' => 'redis',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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\DataTables\DataTablesServiceProvider::class,
|
||||
Yajra\Datatables\ButtonsServiceProvider::class,
|
||||
Yajra\Datatables\HtmlServiceProvider::class,
|
||||
|
||||
Spatie\Permission\PermissionServiceProvider::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' => Facade::defaultAliases()->merge([
|
||||
// 'ExampleClass' => App\Example\ExampleClass::class,
|
||||
'Datatables' => Yajra\Datatables\Facades\Datatables::class,
|
||||
'Custom' => App\Helpers\Custom::class,
|
||||
])->toArray(),
|
||||
|
||||
];
|
|
@ -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 each reset token will 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,70 @@
|
|||
<?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' => [
|
||||
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
'port' => env('PUSHER_PORT', 443),
|
||||
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
],
|
||||
'client_options' => [
|
||||
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||
],
|
||||
],
|
||||
|
||||
'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 the APC, database, memcached, Redis, or DynamoDB cache
|
||||
| stores there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to 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,151 @@
|
|||
<?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,
|
||||
'search_path' => '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,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,90 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
* Namespaces used by the generator.
|
||||
*/
|
||||
'namespace' => [
|
||||
/*
|
||||
* Base namespace/directory to create the new file.
|
||||
* This is appended on default Laravel namespace.
|
||||
* Usage: php artisan datatables:make User
|
||||
* Output: App\DataTables\UserDataTable
|
||||
* With Model: App\User (default model)
|
||||
* Export filename: users_timestamp
|
||||
*/
|
||||
'base' => 'DataTables',
|
||||
|
||||
/*
|
||||
* Base namespace/directory where your model's are located.
|
||||
* This is appended on default Laravel namespace.
|
||||
* Usage: php artisan datatables:make Post --model
|
||||
* Output: App\DataTables\PostDataTable
|
||||
* With Model: App\Post
|
||||
* Export filename: posts_timestamp
|
||||
*/
|
||||
'model' => '',
|
||||
],
|
||||
|
||||
/*
|
||||
* Set Custom stub folder
|
||||
*/
|
||||
//'stub' => '/resources/custom_stub',
|
||||
|
||||
/*
|
||||
* PDF generator to be used when converting the table to pdf.
|
||||
* Available generators: excel, snappy
|
||||
* Snappy package: barryvdh/laravel-snappy
|
||||
* Excel package: maatwebsite/excel
|
||||
*/
|
||||
'pdf_generator' => 'snappy',
|
||||
|
||||
/*
|
||||
* Snappy PDF options.
|
||||
*/
|
||||
'snappy' => [
|
||||
'options' => [
|
||||
'no-outline' => true,
|
||||
'margin-left' => '0',
|
||||
'margin-right' => '0',
|
||||
'margin-top' => '10mm',
|
||||
'margin-bottom' => '10mm',
|
||||
],
|
||||
'orientation' => 'landscape',
|
||||
],
|
||||
|
||||
/*
|
||||
* Default html builder parameters.
|
||||
*/
|
||||
'parameters' => [
|
||||
'dom' => 'Bfrtip',
|
||||
'order' => [[0, 'desc']],
|
||||
'buttons' => [
|
||||
'create',
|
||||
'export',
|
||||
'print',
|
||||
'reset',
|
||||
'reload',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
* Generator command default options value.
|
||||
*/
|
||||
'generator' => [
|
||||
/*
|
||||
* Default columns to generate when not set.
|
||||
*/
|
||||
'columns' => 'id,add your columns,created_at,updated_at',
|
||||
|
||||
/*
|
||||
* Default buttons to generate when not set.
|
||||
*/
|
||||
'buttons' => 'create,export,print,reset,reload',
|
||||
|
||||
/*
|
||||
* Default DOM to generate when not set.
|
||||
*/
|
||||
'dom' => 'Bfrtip',
|
||||
],
|
||||
];
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
* DataTables search options.
|
||||
*/
|
||||
'search' => [
|
||||
/*
|
||||
* Smart search will enclose search keyword with wildcard string "%keyword%".
|
||||
* SQL: column LIKE "%keyword%"
|
||||
*/
|
||||
'smart' => true,
|
||||
|
||||
/*
|
||||
* Multi-term search will explode search keyword using spaces resulting into multiple term search.
|
||||
*/
|
||||
'multi_term' => true,
|
||||
|
||||
/*
|
||||
* Case insensitive will search the keyword in lower case format.
|
||||
* SQL: LOWER(column) LIKE LOWER(keyword)
|
||||
*/
|
||||
'case_insensitive' => true,
|
||||
|
||||
/*
|
||||
* Wild card will add "%" in between every characters of the keyword.
|
||||
* SQL: column LIKE "%k%e%y%w%o%r%d%"
|
||||
*/
|
||||
'use_wildcards' => false,
|
||||
|
||||
/*
|
||||
* Perform a search which starts with the given keyword.
|
||||
* SQL: column LIKE "keyword%"
|
||||
*/
|
||||
'starts_with' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
* DataTables internal index id response column name.
|
||||
*/
|
||||
'index_column' => 'DT_RowIndex',
|
||||
|
||||
/*
|
||||
* List of available builders for DataTables.
|
||||
* This is where you can register your custom dataTables builder.
|
||||
*/
|
||||
'engines' => [
|
||||
'eloquent' => Yajra\DataTables\EloquentDataTable::class,
|
||||
'query' => Yajra\DataTables\QueryDataTable::class,
|
||||
'collection' => Yajra\DataTables\CollectionDataTable::class,
|
||||
'resource' => Yajra\DataTables\ApiResourceDataTable::class,
|
||||
],
|
||||
|
||||
/*
|
||||
* DataTables accepted builder to engine mapping.
|
||||
* This is where you can override which engine a builder should use
|
||||
* Note, only change this if you know what you are doing!
|
||||
*/
|
||||
'builders' => [
|
||||
//Illuminate\Database\Eloquent\Relations\Relation::class => 'eloquent',
|
||||
//Illuminate\Database\Eloquent\Builder::class => 'eloquent',
|
||||
//Illuminate\Database\Query\Builder::class => 'query',
|
||||
//Illuminate\Support\Collection::class => 'collection',
|
||||
],
|
||||
|
||||
/*
|
||||
* Nulls last sql pattern for PostgreSQL & Oracle.
|
||||
* For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction'
|
||||
*/
|
||||
'nulls_last_sql' => ':column :direction NULLS LAST',
|
||||
|
||||
/*
|
||||
* User friendly message to be displayed on user if error occurs.
|
||||
* Possible values:
|
||||
* null - The exception message will be used on error response.
|
||||
* 'throw' - Throws a \Yajra\DataTables\Exceptions\Exception. Use your custom error handler if needed.
|
||||
* 'custom message' - Any friendly message to be displayed to the user. You can also use translation key.
|
||||
*/
|
||||
'error' => env('DATATABLES_ERROR', null),
|
||||
|
||||
/*
|
||||
* Default columns definition of dataTable utility functions.
|
||||
*/
|
||||
'columns' => [
|
||||
/*
|
||||
* List of columns hidden/removed on json response.
|
||||
*/
|
||||
'excess' => ['rn', 'row_num'],
|
||||
|
||||
/*
|
||||
* List of columns to be escaped. If set to *, all columns are escape.
|
||||
* Note: You can set the value to empty array to disable XSS protection.
|
||||
*/
|
||||
'escape' => '*',
|
||||
|
||||
/*
|
||||
* List of columns that are allowed to display html content.
|
||||
* Note: Adding columns to list will make us available to XSS attacks.
|
||||
*/
|
||||
'raw' => ['action'],
|
||||
|
||||
/*
|
||||
* List of columns are forbidden from being searched/sorted.
|
||||
*/
|
||||
'blacklist' => ['password', 'remember_token'],
|
||||
|
||||
/*
|
||||
* List of columns that are only allowed fo search/sort.
|
||||
* If set to *, all columns are allowed.
|
||||
*/
|
||||
'whitelist' => '*',
|
||||
],
|
||||
|
||||
/*
|
||||
* JsonResponse header and options config.
|
||||
*/
|
||||
'json' => [
|
||||
'header' => [],
|
||||
'options' => 0,
|
||||
],
|
||||
|
||||
/*
|
||||
* Default condition to determine if a parameter is a callback or not.
|
||||
* Callbacks needs to start by those terms, or they will be cast to string.
|
||||
*/
|
||||
'callback' => ['$', '$.', 'function'],
|
||||
];
|
|
@ -0,0 +1,76 @@
|
|||
<?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_DISK', '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 set up for each driver as an example of the required values.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
'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),
|
||||
'throw' => 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' => 65536,
|
||||
'threads' => 1,
|
||||
'time' => 4,
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,211 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => [
|
||||
|
||||
'migration' => database_path('migrations/'),
|
||||
|
||||
'model' => app_path('Models/'),
|
||||
|
||||
'datatables' => app_path('DataTables/'),
|
||||
|
||||
'livewire_tables' => app_path('Http/Livewire/'),
|
||||
|
||||
'repository' => app_path('Repositories/'),
|
||||
|
||||
'routes' => base_path('routes/web.php'),
|
||||
|
||||
'api_routes' => base_path('routes/api.php'),
|
||||
|
||||
'request' => app_path('Http/Requests/'),
|
||||
|
||||
'api_request' => app_path('Http/Requests/API/'),
|
||||
|
||||
'controller' => app_path('Http/Controllers/'),
|
||||
|
||||
'api_controller' => app_path('Http/Controllers/API/'),
|
||||
|
||||
'api_resource' => app_path('Http/Resources/'),
|
||||
|
||||
'schema_files' => resource_path('model_schemas/'),
|
||||
|
||||
'seeder' => database_path('seeders/'),
|
||||
|
||||
'database_seeder' => database_path('seeders/DatabaseSeeder.php'),
|
||||
|
||||
'factory' => database_path('factories/'),
|
||||
|
||||
'view_provider' => app_path('Providers/ViewServiceProvider.php'),
|
||||
|
||||
'tests' => base_path('tests/'),
|
||||
|
||||
'repository_test' => base_path('tests/Repositories/'),
|
||||
|
||||
'api_test' => base_path('tests/APIs/'),
|
||||
|
||||
'views' => resource_path('views/'),
|
||||
|
||||
'menu_file' => resource_path('views/layouts/menu.blade.php'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Namespaces
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'namespace' => [
|
||||
|
||||
'model' => 'App\Models',
|
||||
|
||||
'datatables' => 'App\DataTables',
|
||||
|
||||
'livewire_tables' => 'App\Http\Livewire',
|
||||
|
||||
'repository' => 'App\Repositories',
|
||||
|
||||
'controller' => 'App\Http\Controllers',
|
||||
|
||||
'api_controller' => 'App\Http\Controllers\API',
|
||||
|
||||
'api_resource' => 'App\Http\Resources',
|
||||
|
||||
'request' => 'App\Http\Requests',
|
||||
|
||||
'api_request' => 'App\Http\Requests\API',
|
||||
|
||||
'seeder' => 'Database\Seeders',
|
||||
|
||||
'factory' => 'Database\Factories',
|
||||
|
||||
'tests' => 'Tests',
|
||||
|
||||
'repository_test' => 'Tests\Repositories',
|
||||
|
||||
'api_test' => 'Tests\APIs',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Templates
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'templates' => 'adminlte-templates',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Model extend class
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'model_extend_class' => 'Illuminate\Database\Eloquent\Model',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API routes prefix & version
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'api_prefix' => 'api',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'options' => [
|
||||
|
||||
'soft_delete' => false,
|
||||
|
||||
'save_schema_file' => true,
|
||||
|
||||
'localized' => false,
|
||||
|
||||
'repository_pattern' => true,
|
||||
|
||||
'resources' => false,
|
||||
|
||||
'factory' => false,
|
||||
|
||||
'seeder' => false,
|
||||
|
||||
'swagger' => false, // generate swagger for your APIs
|
||||
|
||||
'tests' => false, // generate test cases for your APIs
|
||||
|
||||
'excluded_fields' => ['id'], // Array of columns that doesn't required while creating module
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Prefixes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'prefixes' => [
|
||||
|
||||
'route' => '', // e.g. admin or admin.shipping or admin.shipping.logistics
|
||||
|
||||
'namespace' => '', // e.g. Admin or Admin\Shipping or Admin\Shipping\Logistics
|
||||
|
||||
'view' => '', // e.g. admin or admin/shipping or admin/shipping/logistics
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table Types
|
||||
|
|
||||
| Possible Options: blade, datatables, livewire
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'tables' => 'datatables',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Timestamp Fields
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'timestamps' => [
|
||||
|
||||
'enabled' => true,
|
||||
|
||||
'created_at' => 'created_at',
|
||||
|
||||
'updated_at' => 'updated_at',
|
||||
|
||||
'deleted_at' => 'deleted_at',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Specify custom doctrine mappings as per your need
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
|
||||
'from_table' => [
|
||||
|
||||
'doctrine_mappings' => [],
|
||||
],
|
||||
|
||||
];
|
|
@ -0,0 +1,122 @@
|
|||
<?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'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Deprecations Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the log channel that should be used to log warnings
|
||||
| regarding deprecated PHP and library features. This allows you to get
|
||||
| your application ready for upcoming major versions of dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'deprecations' => [
|
||||
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||
'trace' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.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'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
|
@ -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,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'mailgun' => [
|
||||
'transport' => 'mailgun',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||
],
|
||||
|
||||
'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'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue