fix permission bug
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
|
||||
namespace App\Nova\Resources\Order\Loan\Concerns;
|
||||
|
||||
use App\Nova\Resources\Branch\Branch;
|
||||
use App\Repos\Branch\BranchRepo;
|
||||
use App\Repos\Order\Loan\LoanTypeRepo;
|
||||
use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\System\Settings\Location\RegionRepo;
|
||||
use Laravel\Nova\Fields\Badge;
|
||||
use Laravel\Nova\Fields\BelongsTo;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\Select;
|
||||
use Laravel\Nova\Fields\Text;
|
||||
@@ -33,9 +35,7 @@ class LoanOrderFieldsForIndex
|
||||
->options(RegionRepo::values())
|
||||
->sortable(),
|
||||
|
||||
Select::make(__('Branch'), 'branch_id')
|
||||
->displayUsingLabels()
|
||||
->options(BranchRepo::values())
|
||||
BelongsTo::make(__('Branch'), 'branch', Branch::class)
|
||||
->sortable(),
|
||||
|
||||
Text::make(__('Name'), 'customer_name'),
|
||||
|
||||
@@ -111,7 +111,7 @@ class LoanOrder extends Resource
|
||||
}
|
||||
|
||||
if ($user->isOperator()) {
|
||||
return $query->whereIn('branch_id', $user->branches()->pluck('id'));
|
||||
return $query->whereIn('branch_id', $user->branches()->pluck('branches.id'));
|
||||
}
|
||||
|
||||
return $query->where('user_id', $request->user()->id);
|
||||
|
||||
Reference in New Issue
Block a user