app/Http/Controllers/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)
    {
        $storeData = $request->validate([
            'fname' => 'required|max:255',
            'lname' => 'required|max:255',
            'email' => 'required|max:255',
            'phone' => 'required|max:12',
            'dob' => 'required|max:55',
            'company_id' => 'required|max:25',
        ]);
        $employee = Employee::create($storeData);
        return redirect('/employees')->with('completed', 'Employee has been saved!');
    }
public function store ( Request $ request ) { $ storeData = $ request -> validate ( [ 'fname' => 'required|max:255' , 'lname' => 'required|max:255' , 'email' => 'required|max:255' , 'phone' => 'required|max:12' , 'dob' => 'required|max:55' , 'company_id' => 'required|max:25' , ] ) ; $ employee = Employee :: create ( $ storeData ) ; return redirect ( '/employees' ) -> with ( 'completed' , 'Employee has been saved!' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// dd($request);