برای استفاده از leftjoin در کوئری ها به روش زیر عمل می کنیم
<code>
$query = new Query;
$query->select(['tbl_user.username AS name', 'tbl_category.type as Category'])
->from('tbl_user')
->leftJoin('tbl_category', 'tbl_category.createdby = tbl_user.userid')
->limit(2);
$command = $query->createCommand();
$data = $command->queryAll();
</code>
خروجی به صورت زیر :
<code>
SELECT `tbl_user`.`username` AS `name`, `tbl_category`.`type` AS `Category`
FROM `tbl_user` LEFT JOIN `tbl_category`
ON tbl_category.createdby = tbl_user.useridd
LIMIT 2
</code>



صفرتا صد پروژه فریم ورک لاراول laravel
آموزش مرحله به مرحله (صفر تا صد ) فریم ورک Yii2 ایجاد پروژه (در حال تکمیل)