/** * Run the database seeds. * * @return void */ public function run() { $officer = new Officer(); $officer->member_id = 1; $officer->title = 'President'; $officer->term_id = 1; $officer->save(); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $project = \App\Project::findOrFail($id); $yearslist = \App\Year::lists('year', 'id'); $companies = \App\Company::findOrFail($project->company_id); $officers_for_dropdown = \App\Officer::lists('last_name', 'id'); return view('pages.project.edit', compact('project', 'companies', 'officers_for_dropdown', 'yearslist')); }
/** * Run the database seeds. * * @return void */ public function run() { $company_id = \App\Company::where('company_name', '=', 'ACME Corporation')->pluck('id'); $officer_id = \App\Officer::where('last_name', '=', 'Bale')->pluck('id'); DB::table('projects')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'new_employment_commit' => 200, 'award_percent' => 85, 'company_id' => $company_id, 'officer_id' => $officer_id]); $company_id = \App\Company::where('company_name', '=', 'The ABC Corporation')->pluck('id'); $officer_id = \App\Officer::where('last_name', '=', 'Ronaldo')->pluck('id'); DB::table('projects')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'new_employment_commit' => 200, 'award_percent' => 65, 'company_id' => $company_id, 'officer_id' => $officer_id]); $company_id = \App\Company::where('company_name', '=', 'YXZ Corporation')->pluck('id'); $officer_id = \App\Officer::where('last_name', '=', 'Chan')->pluck('id'); DB::table('projects')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'new_employment_commit' => 200, 'award_percent' => 50, 'company_id' => $company_id, 'officer_id' => $officer_id]); $company_id = \App\Company::where('company_name', '=', 'DIC Consulting Group')->pluck('id'); $officer_id = \App\Officer::where('last_name', '=', 'Guerrero')->pluck('id'); DB::table('projects')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'new_employment_commit' => 200, 'award_percent' => 80, 'company_id' => $company_id, 'officer_id' => $officer_id]); $company_id = \App\Company::where('company_name', '=', 'ACME Corporation')->pluck('id'); $officer_id = \App\Officer::where('last_name', '=', 'Bale')->pluck('id'); DB::table('projects')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'new_employment_commit' => 200, 'award_percent' => 75, 'company_id' => $company_id, 'officer_id' => $officer_id]); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function ConfirmDelete($id) { # Get the Officer to be deleted $officer = \App\Officer::findOrFail($id); return view('pages.officer.delete', compact('officer')); }
/** * Remove the specified officer from storage. * * @Delete("/{id}") * @Response(200) * @param int $id * @return Response */ public function destroy($id) { Officer::destroy($id); return response('', Response::HTTP_NO_CONTENT); }