class PostController extends BaseController{
private $auth;
public function __construct() {
parent::__construct();
$this->auth = Auth::user();
}
public function index() {
// $this->auth = Auth::user();
dd($this->auth);
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
abstract class BaseController extends Controller
{
public function authUser()
{
return Auth::user();
}
}
$this->authUser()
со всеми вытекающими