Answer the question
In order to leave comments, you need to log in
Why doesn't a private method return a result?
I have a controller with two methods
class ProfileController extends Controller
{
public function showProfile()
{
self::checkUserAuth();
}
private function checkUserAuth()
{
if (Auth::check())
{
return view('profile.index');
}
else
{
return redirect('/');
}
}
}
} Answer the question
In order to leave comments, you need to log in
I highly recommend learning the basics of PHP.
public function showProfile()
{
return $this->checkUserAuth();
}
an error in the showProfile method... I see no point in suggesting further.
ps I advise you to read the documentation for PHP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question