/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(OccupationRequest $request) { Occupation::create($request->all()); $request->session()->flash('alert-success', 'New occupation was successfully added!'); return redirect('/occupations'); }
public function run() { DB::table('occupations')->delete(); Occupation::create(['id' => '1', 'occupation' => 'Business & Finance']); Occupation::create(['id' => '2', 'occupation' => 'Computers & Technology']); Occupation::create(['id' => '3', 'occupation' => 'Construction Trades']); Occupation::create(['id' => '4', 'occupation' => 'Education, Teaching & Training']); Occupation::create(['id' => '5', 'occupation' => 'Engineering & Engineering Technicians']); Occupation::create(['id' => '6', 'occupation' => 'Fishing, Farming & Forestry']); Occupation::create(['id' => '7', 'occupation' => 'Health & Medical']); Occupation::create(['id' => '8', 'occupation' => 'Hospitality, Travel & Tourism']); Occupation::create(['id' => '9', 'occupation' => 'Media Communications & Broadcasting']); Occupation::create(['id' => '10', 'occupation' => 'Military & Armed Forces']); Occupation::create(['id' => '11', 'occupation' => 'Office Administration & Management']); Occupation::create(['id' => '12', 'occupation' => 'Production & Manufacturing']); Occupation::create(['id' => '13', 'occupation' => 'Professional & Service']); Occupation::create(['id' => '14', 'occupation' => 'Psychology & Counseling']); Occupation::create(['id' => '15', 'occupation' => 'Installation, Repair & Maintenance']); Occupation::create(['id' => '16', 'occupation' => 'Sales & Marketing']); Occupation::create(['id' => '17', 'occupation' => 'Social & Life Sciences']); Occupation::create(['id' => '18', 'occupation' => 'Transportation & Moving']); }