Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with laravel 5.8 #310

Open
alfredkoncsag opened this issue May 7, 2019 · 6 comments
Open

Not working with laravel 5.8 #310

alfredkoncsag opened this issue May 7, 2019 · 6 comments

Comments

@alfredkoncsag
Copy link

alfredkoncsag commented May 7, 2019

This package not working with laravel 5.8, or do you have new release for laravel 5.8 version?

 /vendor/baum/baum/src/Baum/Move.php:357

    355|     $method = $halt ? 'until' : 'fire';
    356| 
  > 357|     return static::$dispatcher->$method($event, $this->node);

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.

@mkwsra
Copy link

mkwsra commented May 9, 2019

Just use the new version
"baum/baum": "2.x",

it's mentioned here as well

@karigarweb
Copy link

It just throws another error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'right' in 'order clause' (SQL: select * from types order by right 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');`

@mkwsra
Copy link

mkwsra commented May 17, 2019

@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

@karigarweb
Copy link

Thanks @mkwsra, this fixed the issue.

@mkwsra
Copy link

mkwsra commented May 20, 2019

And you may use properties if you would like:

    $leftColumnName = 'lft';
    $rightColumnName = 'rgt';

@shinnlu
Copy link

shinnlu commented Sep 21, 2019

thanks @mkwsra , it's really help to solve problem from 5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants