请尝试在仪表板视图上检索事件数据和学生数据,但它们似乎相互冲突。学生记录也显示在我的事件记录应该显示的位置。这是它的样子:
航线
Route::post('/dashboard/submit', 'EventController@submit');
Route::get('/dashboard', 'EventController@getevent');
Route::post('/dashboard/student/pay', 'PaymentController@submit');
Route::post('register','StudentRegister@register');
Route::get('/dashboard', 'StudentRegister@getStudents');
事件控制器.php
class EventController extends Controller
{
public function submit(Request $request)
{
$message = new Event;
$message->title = $request->input('title');
$message->deadline = $request->input('deadline');
$message->message = $request->input('message');
$message->save();
return redirect('/dashboard')->with('status', 'Event Added');
}
public function getevent()
{
$msgevent = Event::orderBy('id', 'DESC')->get();
return view('dashboard')->with('dashboard', $msgevent);
}
}
学生注册.php
public function getStudents(){
$Students = Student::all();
return view('dashboard') -> with('dashboard', $Students);
}
月关宝盒
神不在的星期二