38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace Modules\Writeoff\Http\Controllers;
|
||
|
|
||
|
use App\Http\Controllers\Controller;
|
||
|
use Illuminate\Http\Request;
|
||
|
use Illuminate\Support\Facades\Auth;
|
||
|
use Modules\Writeoff\DataTables\GuaranteeTypeDataTable;
|
||
|
|
||
|
class GuaranteeTypeController extends Controller
|
||
|
{
|
||
|
public $user;
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->middleware(function ($request, $next) {
|
||
|
$this->user = Auth::guard('web')->user();
|
||
|
return $next($request);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Display a listing of the GuaranteeTypes.
|
||
|
*
|
||
|
* @param \Modules\Writeoff\DataTables\GuaranteeTypeDataTable $dataTable
|
||
|
*
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function index(GuaranteeTypeDataTable $dataTable, Request $request)
|
||
|
{
|
||
|
if (is_null($this->user) || !$this->user->can('master.read')) {
|
||
|
abort(403, 'Sorry !! You are Unauthorized to view any master data !');
|
||
|
}
|
||
|
|
||
|
return $dataTable->render('writeoff::parameter.guarantee_types.index');
|
||
|
}
|
||
|
}
|