SimBrief : Generate New Briefing (#986)
* Add SB Briefing Removal Route Route will be called from simbrief.briefing.blade * SimBrief Controller and Briefing Blade Update Added the remove function to controller, which removes the simbrief ofp if no pirep_id is present, else it just nulls the flight_id for to be able to create a new SB pack Also added the button to blade for it to work * Style Fix love styleci
This commit is contained in:
@@ -80,6 +80,29 @@ class SimBriefController
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the flight_id from the SimBrief Briefing (to a create a new one)
|
||||
* or if no pirep_id is attached to the briefing delete it completely
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*/
|
||||
public function remove(Request $request)
|
||||
{
|
||||
$sb_pack = SimBrief::find($request->id);
|
||||
if ($sb_pack) {
|
||||
if (!$sb_pack->pirep_id) {
|
||||
$sb_pack->delete();
|
||||
} else {
|
||||
$sb_pack->flight_id = null;
|
||||
$sb_pack->save();
|
||||
}
|
||||
}
|
||||
|
||||
return redirect(route('frontend.flights.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a prefile of this PIREP with a given OFP. Then redirect the
|
||||
* user to the newly prefiled PIREP
|
||||
|
||||
Reference in New Issue
Block a user