Laravel's Eloquent. How to write a query jonom base table?

Good time of day. There is here such request:
SELECT t1.* FROM `themes` as t1
LEFT JOIN `themes` as t2
ON t1.parent_id = t2.id
WHERE t2.slug = :slug

To get the array objects in the model happens like this trash:
self::hydrate(
DB::select(
 "SELECT t1.* FROM `themes` as t1
 LEFT JOIN `themes` as t2
 ON t1.parent_id = t2.id
 WHERE t2.slug = :slug", ['slug' => (string) $marker])
 )->all();


But you want beautiful....

self::where()->join...

Actually how to rewrite this piece of Projecta for Eloquent?

Thank you )))

Thanks for the replies. If someone can help:
self::select('themes.*')
 ->join('as t2 themes', 'themes.parent_id', '=', 't2.id')
 -> where('t2.slug', '=', $marker)
 -> get()
 -> all();
June 10th 19 at 15:11
1 answer
June 10th 19 at 15:13
Solution
Thank you kind man - jaeden commented on June 10th 19 at 15:16

Find more questions by tags Laravel