--- ERROR MESSAGE语法错误,意想不到 '{' - Laravel
FatalErrorException在BooksController.php线66:语法错误, 意外 '{'
- 线66
$book = DB::table('books')->where('id', $id)->first();
--- CO DE
public function request(Request $request, $id) {
$book = DB::table('books')->where('id', $id)->first();
$user_id = {{ Auth::guard('web')->user()->id }}
DB::table('book_requests')->insert(
['book_id' => $book->id, 'user_id' => $user_id ]
);
}
在此先感谢