/專案/routes/web.php
Route::post('/exam', 'ExamController@store')->name('exam.store');
/專案/app/Http/Controllers/ExamController.php
store
public function store(Request $request) { $exam = new Exam; $exam->title = $request->title; $exam->user_id = $request->user_id; $exam->enable = $request->enable; $exam->save(); return redirect()->route('exam.index'); }
<?php namespace App\Http\Controllers; use App\Exam; use Illuminate\Http\Request;
$request
Exam
redirect()
進階搜尋