I want to get some rows from posts table. I use eloquant and, I don't know how do I make it.
I have five tables :
posts-reviews
or specs
) and post_table
)I want to jump those three tables from suspended_users
.
And I tried to below way inside of Suspect model.
But doesn't work!
$this->join("post_translations as pt", "pt.id", "=", "suspended_users.article_id")
->join($this->post_type." as p", "p.id", "=", "post_translations.post_id")
->select($this->post_type.".*")
->get();
You can try to use DB::raw
function. Try this:
$this->join(\DB::raw("post_translations as pt"), "pt.id", "=", "suspended_users.article_id")
->join(\DB::raw($this->post_type." as p"), "p.id", "=", "post_translations.post_id")
->select($this->post_type.".*")
->get();
You should try this:
$this->select("p.*")->join("post_translations as pt", "pt.id", "=", "suspended_users.article_id")
->join($this->post_type." as p", "p.id", "=", "post_translations.post_id")
->get();