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)
    {
        $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'companyId' => 'required',
        ]);
        $data = $request->except(['_token']);
        Employee::create($data);
        session()->flash('message','Employee Create Successfully!!');
        return redirect()->route('employee.index');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'name' => 'required' , 'email' => 'required|email' , 'companyId' => 'required' , ] ) ; $ data = $ request -> except ( [ '_token' ] ) ; Employee :: create ( $ data ) ; session ( ) -> flash ( 'message' , 'Employee Create Successfully!!' ) ; return redirect ( ) -> route ( 'employee.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// dd($data);