Enabled address undelete and purge, now showing systems deleted messages

This commit is contained in:
Deon George
2022-11-19 12:02:13 +11:00
parent 739955d374
commit 5957a25044
6 changed files with 69 additions and 14 deletions

View File

@@ -517,6 +517,46 @@ class SystemController extends Controller
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
}
/**
* Recover a deleted address
*
* @param int $id
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function rec_address(int $id)
{
$o = Address::onlyTrashed()->findOrFail($id);
// @todo This should be admin of the zone
$this->authorize('admin',$o);
session()->flash('accordion','address');
$o->restore();
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
}
/**
* Recover a deleted address
*
* @param int $id
* @return \Illuminate\Http\RedirectResponse
* @throws \Illuminate\Auth\Access\AuthorizationException
*/
public function pur_address(int $id)
{
$o = Address::onlyTrashed()->findOrFail($id);
// @todo This should be admin of the zone
$this->authorize('admin',$o);
session()->flash('accordion','address');
$o->forceDelete();
return redirect()->to(sprintf('ftn/system/addedit/%d',$o->system_id));
}
/**
* register system
*/