return $next($request);
이있는 행이 Trying to get a property of a non object
오류가 발생하는 미들웨어에서 이상한 문제가 발생하지만 내 프로덕션 서버에서만이 문제를 로컬로 재현 할 수 없습니다.미들웨어의 객체가 아닌 객체의 속성을 얻으려고 시도합니다
<?php
namespace App\Http\Middleware;
use Closure;
class NotSubscribed
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (isSubscribed($request->user()) || getOrganisation()->skip_plan) {
flashError('You already have a subscription to Tradesoft.');
return redirect(url(''));
}
return $next($request);
}
}