/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $metadata_field = App\MetadataField::find($id); $metadata_field->items()->detach(); App\MetadataField::destroy($id); flash()->success('Success!', 'The field <strong>' . e($metadata_field->name) . '</strong> has been destroyed.'); return redirect()->action('MetadataFieldsController@index'); }
/** * Show the form for creating a new resource. * * @return Response */ public function create($metadata_field_id) { $metadata_field = App\MetadataField::find($metadata_field_id); return view('metadata_fielditems.create', compact('metadata_field')); }