atayahmet / laravel-nestable

Laravel 5 nested category/menu generator
MIT License
214 stars 52 forks source link

leftJoin not working with Category Model using NestableTrait #73

Open muhrizwan opened 5 years ago

muhrizwan commented 5 years ago

I have the following code in Category Model:

<?php

use Nestable\NestableTrait;

class Category extends \Eloquent {

    use NestableTrait;

    protected $parent = 'parent_id';

}

And

Category::attr(['name' => 'categories'])
    ->selected(2)
    ->renderAsDropdown();

The above code works fine. But in some other function in Controller when I use leftJoin function with Category Model, leftJoin is not working. I have something like below:

Category: leftjoin('expense','category.id','expense.category_id')->get();

in above eloquent leftjoin is not rendering in response. Any help?