skip to Main Content

How can I display book details in Laravel using Eloquent join and where clauses?

Undefined property: IlluminateDatabaseQueryBuilder::$title public function show(string $id) { $books = DB::table("book_tbls") ->where("author_tbls.id", "=", $id) ->where("author_tbls.id", "=", "book_tbls . author_id") ->where("categories.id", "=", $id) ->where("categories.id", "=", "book_tbls . category_id"); // $books = book_tbl::find($id); return view('books.show', compact('books')); } I am learning laravel for…

VIEW QUESTION

how to Laravel eloquent having array

how to type this sql in laravel eloquent 10 $data = array:2 [ 0 => "3" 1 => "5" 2 => "1" ] relations public function followActionFollowStudent() { return $this->hasMany(FollowActionFollowStudent::class, 'follow_student_id', id'); } i need sql as this below select…

VIEW QUESTION
Back To Top
Search