DevMarketer / multiauth_tutorial

156 stars 83 forks source link

$guard = array_get($exception->guards(), 0); #29

Open MuhammadAbeerAkmal opened 4 years ago

MuhammadAbeerAkmal commented 4 years ago

I am facing the problem for this line $guard = array_get($exception->guards(), 0); when I use blog.test/home it gives this error Symfony\Component\Debug\Exception\FatalThrowableError Call to undefined function App\Exceptions\array_get()

what could be the problem and what's the solution?

BippyMiester commented 4 years ago

This is due to some Laravel versioning issues. I'm going to push an update to fix this issue, as I've already fixed this issue in many of my projects. Stay tuned!

I first need @jacurtis to allow me to push this hotfix.

Here is the minor change to fix this issue, prior to the update being released.

change the array_get() method to the following:

$guard = Arr::get($exception->guards(), 0);

Then make sure to include/use the Illuminate\Support\Arr class.