hootlex / laravel-friendships

This package gives Eloquent models the ability to manage their friendships.
MIT License
706 stars 151 forks source link

Will this work #133

Closed CactusJasper closed 4 years ago

CactusJasper commented 4 years ago

Will this work in Laravel 6.x I know this isn't an issue, however, I would love to know

ractoon commented 4 years ago

I'm currently using this in a Laravel 6 project. Things seem to be working as expected.

kingga commented 4 years ago

@ractoon I'm using this in Laravel 6 as well and their seems to be a problem with events.

Call to undefined method Illuminate\Events\Dispatcher::fire()

Small trace:

0:
message: "Call to undefined method Illuminate\Events\Dispatcher::fire()"
exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
file: "/home/vagrant/isapi/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php"
line: 261

1:
file: "/home/vagrant/isapi/vendor/hootlex/laravel-friendships/src/Traits/Friendable.php"
line: 35
function: "__callStatic"
class: "Illuminate\Support\Facades\Facade"
type: "::"

2:
file: "/home/vagrant/isapi/app/Http/Controllers/FriendshipController.php"
line: 35
function: "befriend"
class: "App\User"
type: "->"

If you want to use this as I did I would recommend forking it and just changing everything which uses Event::fire to Event::dispatch in /src/Traits/Friendable.php. Their is a pull request for this already but it seems to have some issues #132.

CactusJasper commented 4 years ago

ok thank you it's working fine now