Add Employee
EmployeeController.php
<?php
/**
* Store a new employee in the database.
* We'll write the Eloquent logic for this in the episode.
*/
public function store(Request $request)
{
// TODO (LEP 03): validate the request, then create the record
// with the Employee model — e.g. Employee::create($request->all());
$employee = Employee::create($request->all());
// Employee::create([
// 'name' => $request->name,
// 'age' => $request->age
// ]);
// return redirect()->url('laravel-interview/lep3_eloquent');
return redirect('/laravel-interview/lep3_eloquent');
}