/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // // dd($request); $typeDeContrat = TypeContrat::create($request->all()); return redirect(route('typeDeContrat.index')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $personnel = Personnels::findOrFail($id); $typedecontrat = TypeContrat::lists('type_de_contrat', 'id')->toArray(); return view('personnel.edit', compact('personnel', 'typedecontrat')); }
public function scopegetContrat() { return TypeContrat::where('id', $this->type_de_contrat_id); }