added check if expense is closed, user cannot edit
This commit is contained in:
@@ -141,6 +141,11 @@ class FormUpCountryController extends Controller
|
||||
$this->checkAuthorization(auth()->user(), ['forms.country.edit']);
|
||||
|
||||
$form = FormUpCountry::with('rayon')->findOrfail($id);
|
||||
if($form->status == 'Closed') {
|
||||
session()->flash('error', 'Form has been closed, you cannot edit it.');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
return view('backend.pages.forms.upcountry.edit', [
|
||||
'rayons' => Rayon::all(),
|
||||
'form' => $form
|
||||
@@ -166,6 +171,11 @@ class FormUpCountryController extends Controller
|
||||
]);
|
||||
|
||||
$form = FormUpCountry::findOrfail($id);
|
||||
if($form->status == 'Closed') {
|
||||
session()->flash('error', 'Form has been closed, you cannot edit it.');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$cabang = UserHasCabang::with('cabang')->where('user_id', $form->user_id)->first()->cabang;
|
||||
$region = Region::where('id', $cabang->region_id)->first();
|
||||
$kategori = Kategori::where('name', 'Up Country')->first();
|
||||
|
||||
Reference in New Issue
Block a user