app/Http/Controllers/Admin/EmployeeController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $request->validate([
            'firstname' => 'required',
            'lastname' => 'required',
            'email' => 'required|email',
            'company' => 'required'
        ]);
        Employee::create([
            'company_id' => $request->company,
            'firstname' => $request->firstname,
            'lastname' => $request->lastname,
            'email' => $request->email,
            'website' => $request->website,
            'phone' => $request->phone
        ]);
        return redirect()->back()->with('success','Employee information has been saved successfully');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'firstname' => 'required' , 'lastname' => 'required' , 'email' => 'required|email' , 'company' => 'required' ] ) ; Employee :: create ( [ 'company_id' => $ request -> company , 'firstname' => $ request -> firstname , 'lastname' => $ request -> lastname , 'email' => $ request -> email , 'website' => $ request -> website , 'phone' => $ request -> phone ] ) ; return redirect ( ) -> back ( ) -> with ( 'success' , 'Employee information has been saved successfully' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .