Open alfredkoncsag opened 5 years ago
Just use the new version
"baum/baum": "2.x",
it's mentioned here as well
It just throws another error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'right' in 'order clause' (SQL: select * from
types
order byright
desc limit 1 lock in share mode)
Although my model is configured correctly with following code:
`class Type extends Node implements HasMedia {
use HasMediaTrait, VueTableSearch;
/**
* Table name.
*
* @var string
*/
protected $table = 'types';
protected $searchAble = [
'name', 'slug',
];
protected $fillable = ['name','slug','status','lat','lng','parent_id', 'order_id'];
protected $filterJoins = ['parent' => ['name']];
protected $parentColumn = 'parent_id';
protected $leftColumn = 'lft';
protected $rightColumn = 'rgt';
protected $depthColumn = 'depth';
protected $orderColumn = 'rgt';
protected $guarded = array('id', 'parent_id', 'lft', 'rgt', 'depth');`
@karigarweb since version 2, not sure which tag specifically but you have to do it this way:
/**
* Get the "default" left column name.
*
* @return string
*/
public function getDefaultLeftColumnName()
{
return 'lft';
}
/**
* Get the "default" right column name.
*
* @return string
*/
public function getDefaultRightColumnName()
{
return 'rgt';
}
And for sure there is no need for the protected attributes
Thanks @mkwsra, this fixed the issue.
And you may use properties if you would like:
$leftColumnName = 'lft';
$rightColumnName = 'rgt';
thanks @mkwsra , it's really help to solve problem from 5.8
This package not working with laravel 5.8, or do you have new release for laravel 5.8 version?
Laravel Upgrade Guide 5.8: The fire Method Likelihood Of Impact: Low
The fire method (which was deprecated in Laravel 5.4) of the Illuminate\Events\Dispatcher class has been removed. You should use the dispatch method instead.