[Symfony\Component\Debug\Exception\FatalErrorException]
Call to a member function getPrefix() on a non-object
[2017-01-30 01:24:22] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to a member function getPrefix() on a non-object' in ***********\app\Http\Controllers\AdminController.php:19
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Events\AuthTime;
use Auth;
class AdminController extends Controller
{
public $path;
public function __construct(Request $request)
{
event(new AuthTime(Auth::user()));
$this->path = $request->path();
view()->share('currentPrefix', $request->route()->getPrefix());
view()->share('currentRouteName', $this->currentRouteName());
}
}
$route = $request->route();
$prefix = $route ? $route->getPrefix() : null;
view()->share('currentPrefix', $prefix);