John Davidson

php - Can't understand why there is a syntax error - laravel syntax error

0 comments
Message:


I haven't changed anything to the 1st route. I only added the form submission routes then the error occurred, yet it's pointing to the first route?


The error points to line 17 with the following, yet I can't understand why.


syntax error, unexpected token "::", expecting "," or ";"


17> Route::get('/', function () {
return view('welcome');
});


// AiFx - This route allows the guests to view the page - //
Route::get('/guests', function () {
return view('guests');
});

// AiFx - This route allows the completed form to be submitted to DB - this one didnt populate the DB!!??- //
Route::post('/guests', function () {
$GuestController::create([
'fname' => request.query->get('fname'),
'lname' => request.query->get('lname'),
'id_number' => request.query->get('id_number'),
'mobile' => request.query->get('mobile'),
'sqsymptoms' => request.query->get('sqsymptoms'),
'sqtravel' => request.query->get('sqtravel'),
'sqcontact' => request.query->get('sqcontact'),
])
public function getRouteKey() {
return $this->submit;
}
});

Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth'])->name('dashboard');

require __DIR__.'/auth.php';


My Answer:
you please provide more context or clarify your question?

Rate this post

5 of 5 based on 7814 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us