Laravel ErrorException - laravel

So i've made some changes. And I have no idea what happened, but this pops up on pretty much every view.
If anyone knows what's up, I would be very thankful.
Sometimes you make a change and just don't know what happened.
ErrorException in b3eeef2137d2dbfb09f05e2d167697b945108e1f.php line 12:
Trying to get property of non-object (View: C:\xampp\htdocs\system\resources\views\welcome.blade.php)
in b3eeef2137d2dbfb09f05e2d167697b945108e1f.php line 12
at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('C:\xampp\htdocs\reserveersysteem\storage\framework\views/b3eeef2137d2dbfb09f05e2d167697b945108e1f.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag))) in CompilerEngine.php line 59
at CompilerEngine->get('C:\xampp\htdocs\reserveersysteem\resources\views/welcome.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 45
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1017
at Router->prepareResponse(object(Request), object(View)) in Router.php line 642
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
EDIT:
Below is the code in my welcome.blade.php:
#extends("layout")
#section("content")
<div class="content">
<h1>Under Construction</h1>
<div class="logomainpage">
</div>
<div class="title m-b-md">
Reserveertool
</div>
<div class="links">
#if(Auth::user()->type == 1 || 2)
Overzicht zalen
#endif
Inloggen als bestaande klant
Zaal reserveren
Account
Contact
</div>
</div>
#endsection

You are not logged in during testing

If you sure that you added type attribute, add one more conditional step before this.
#extends("layout")
#section("content")
<div class="content">
<h1>Under Construction</h1>
<div class="logomainpage">
</div>
<div class="title m-b-md">
Reserveertool
</div>
#if (Auth::guest())
<li>Login</li>
#else
<div class="links">
#if(Auth::user()->type == 1 || 2)
Overzicht zalen
#endif
Inloggen als bestaande klant
Zaal reserveren
Account
Contact
</div>
#endif
</div>
#endsection

Related

FatalThrowableError in Encrypter.php line 73: Call to undefined function openssl_encrypt()

I bought a script (radio web portal) which use Laravel framework but I have the following error :
FatalThrowableError in Encrypter.php line 73:
Call to undefined function openssl_encrypt()
in Encrypter.php line 73
at Encrypter->encrypt('msDJBCdI0hnJ95VuR6dnHo4jmZwo13AVVcb2FNEq') in
EncryptCookies.php line 131
at EncryptCookies->encrypt(object(Response)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php
line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 104
at Pipeline->then(object(Closure)) in Router.php line 644
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php
line 618
at Router->dispatchToRoute(object(Request)) in Router.php line 596
at Router->dispatch(object(Request)) in Kernel.php line 267
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in
Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Debugbar.php
line 51
at Debugbar->handle(object(Request), object(Closure)) in Pipeline.php line
137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in
Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 104
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 53
in Encrypter.php line 73
at Encrypter->encrypt('a:5:
{s:6:"_token";s:40:"msDJBCdI0hnJ95VuR6dnHo4jmZwo13AVVcb2FNEq";s:9:"_previous";a:1:{s:3:"url";s:47:"http://localhost/sito2/radiowebportal/index.php";}s:22:"PHPDEBUGBAR_STACK_DATA";a:0:{}s:9:"_sf2_meta";a:3:{s:1:"u";i:1526184338;s:1:"c";i:1526184338;s:1:"l";s:1:"0";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}') in EncryptedStore.php line 57
at EncryptedStore->prepareForStorage('a:5:{s:6:"_token";s:40:"msDJBCdI0hnJ95VuR6dnHo4jmZwo13AVVcb2FNEq";s:9:"_previous";a:1:{s:3:"url";s:47:"http://localhost/sito2/radiowebportal/index.php";}s:22:"PHPDEBUGBAR_STACK_DATA";a:0:{}s:9:"_sf2_meta";a:3:{s:1:"u";i:1526184338;s:1:"c";i:1526184338;s:1:"l";s:1:"0";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}') in Store.php line 262
at Store->save() in StartSession.php line 88
at StartSession->terminate(object(Request), object(Response)) in Kernel.php line 176
at Kernel->terminate(object(Request), object(Response)) in index.php line 58
First make sure you installed the openssl extension (spotted by deceze), then:
Go to your php.ini file
Remove the semicolon before extension=php_openssl.dll
Restart your Apache
I'm expecting this to be the problem.

ErrorException in Filesystem.php line 41: File does not exist at path

i have this problem after add a new controller in my laravel project
2/2
ErrorException in Filesystem.php line 41:
File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php (View: )
1/2
FileNotFoundException in Filesystem.php line 41:
File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php
The URL are OK, the view is in the right position.
I have this problem for any call to this controller and only in this controller
Im using Laravel 5.2 in a server with CentOS 5.8. Thanks
This is the complete error:
2/2
ErrorException in Filesystem.php line 41:
File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php (View: )
in Filesystem.php line 41
at CompilerEngine->handleViewException(object(FileNotFoundException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/xxxxxx/resources/views/cpanel/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(ControlpanelController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'xxxxxx\Http\Controllers\ControlpanelController', 'index') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54
1/2
FileNotFoundException in Filesystem.php line 41:
File does not exist at path /home/xxxxxx/resources/views/layouts/controlPanel.blade.php
in Filesystem.php line 41
at Filesystem->get('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php') in BladeCompiler.php line 114
at BladeCompiler->compile('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php') in CompilerEngine.php line 51
at CompilerEngine->get('/home/xxxxxx/resources/views/layouts/controlPanel.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'obLevel' => '1', 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in 9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php line 195
at include('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/xxxxxx/storage/framework/views/9bdb98dce9caefbaf93ee2cca3b1c3dc34cfcf0e.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/xxxxxx/resources/views/cpanel/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'create' => '3', 'what' => 'nothing', 'notifications' => object(Collection))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 201
at Response->__construct(object(View)) in Router.php line 1085
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(ControlpanelController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'xxxxxx\Http\Controllers\ControlpanelController', 'index') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 724
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 64
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 726
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 699
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54

NotFoundHttpException in Handler.php line 131: laravel

For some reason I'm getting this error
NotFoundHttpException in Handler.php line 131: No query results for model [App\Modules\Menus\Models\Menu].
I shouldn't be getting this error since I'm not referencing the menu model at all in my dashboard function.
I've done route:clear and route:cache without any success.
Here is my CustomersController
namespace App\Modules\Customers\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Modules\Menus\Models\Menu;
use App\Modules\Customers\Models\Customer;
use DB;
use Validator;
Use Mail;
use Auth;
class CustomersController extends Controller
{
public function login(Request $request)
{
$this->validate($request, [
'email' => 'required|email',
'password' => 'required'
]);
if(auth('customer_admin')->attempt(array('email' => $request->input('email'), 'password' => $request->input('password'))))
{
if(auth()->guard('customer_admin')->user()->is_activated == '0')
{
$this->logout();
return back()->with('error', 'Please activate your account.');
}
return redirect()->route('dashboard');
}else{
return back()->with('error', 'Your email/password combination is wrong.');
}
}
public function dashboard()
{
echo "dashboard";
}
}
My web.php routes
Route::get('/signup', [
'uses' => 'CustomersController#signup',
'as' => 'customer.signup'
]);
Route::post('/signup', [
'uses' => 'CustomersController#postSignup',
'as' => 'post.signup'
]);
Route::get('customer/activation/{token}', [
'uses' => 'CustomersController#customerActivation',
'as' => 'activation',
]);
Route::post('/login', [
'uses' => 'CustomersController#login',
'as' => 'login'
]);
// CUSTOMER LOGIN
Route::get('/dashboard', [
'uses' => 'CustomersController#dashboard',
'as' => 'dashboard'
]);
Route::get('/logout', [
'uses' => 'CustomersController#logout',
'as' => 'logout'
]);
The full stack trace
in Handler.php line 131
at Handler->prepareException(object(ModelNotFoundException)) in Handler.php
line 109
at Handler->render(object(Request), object(ModelNotFoundException)) in
Handler.php line 47
at Handler->render(object(Request), object(ModelNotFoundException)) in
Pipeline.php line 82
at Pipeline->handleException(object(Request),
object(ModelNotFoundException)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php
line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in
Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
1/2 ModelNotFoundException in Builder.php line 395: No query results for
model [App\Modules\Menus\Models\Menu].
in Builder.php line 395
at Builder->firstOrFail() in OpenController.php line 52
at OpenController->content('dashboard')
at call_user_func_array(array(object(OpenController), 'content'), array('id'
=> 'dashboard')) in Controller.php line 55
at Controller->callAction('content', array('id' => 'dashboard')) in
ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(OpenController),
'content') in Route.php line 204
at Route->runController() in Route.php line 160
at Route->run() in Router.php line 559
at Router->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
SubstituteBindings.php line 41
at SubstituteBindings->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
VerifyCsrfToken.php line 65
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
StartSession.php line 64
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php
line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 102
at Pipeline->then(object(Closure)) in Router.php line 561
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php
line 520
at Router->dispatchToRoute(object(Request)) in Router.php line 498
at Router->dispatch(object(Request)) in Kernel.php line 174
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in
Pipeline.php line 30
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
TransformsRequest.php line 30
at TransformsRequest->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
ValidatePostSize.php line 27
at ValidatePostSize->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in
CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in
Pipeline.php line 148
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php
line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php
line 102
at Pipeline->then(object(Closure)) in Kernel.php line 149
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116
at Kernel->handle(object(Request)) in index.php line 54
I see:
Route::post('/login', [
'uses' => 'CustomersController#login',
'as' => 'login'
]);
How about the respective:
Route::get('/login', [
'uses' => 'CustomersController#loginPage',
'as' => 'page.login'
]);
You could also redirect the user to login route when they hit dashboard route.
public function dashboard()
{
return redirect("login"); //redirect to login page
}
As an aside, re-arrange your use statements to:
use DB;
Use Mail;
use Auth;
use Validator;
use App\Http\Requests;
use Illuminate\Http\Request;
use App\Modules\Menus\Models\Menu;
use App\Http\Controllers\Controller;
use App\Modules\Customers\Models\Customer;
This has nothing to do with the error you are having, its just a good practice. My answer to your question is in your routes file like shown above.
I assume you're using Laravel 5.2 given the routes file named web.php
Your routes are loaded into RouteServiceProvider and it assumes all the controllers are located under namespace App\Http\Controllers
I've noticed that your controller is under App\Modules\Customers\Http\Controllers namespace.
So the correct way to define routes for it is specifying the complete namespace to it. See the example:
<?php
Route::get('/signup', [
'uses' => '\App\Modules\Customers\Http\Controllers\CustomersController#signup',
'as' => 'customer.signup'
]);
Another (and better) way is to define a dedicated RouteServiceProvider for each "module" of your application. Check your default provider under app/Providers/RouteServiceProvider.php file to know how it works.

using lumen 5.2 with blade template engine?

I follow the official documentation of laravel to create templates with blade.I'm trying to make my first template but doesn't work.
1)Stored in resources/views/default.blade.php --->
<html>
<head>
#include('includes.head')
</head>
<body>
<div class="container">
#include('includes.header')
<div id="main" class="row">
#yield('content')
</div>
</div>
</body>
</html>
2)stored in resources/views/home.blade.php -->
#extends('layouts.default')
#section('content')
I am the Home Page!
#endsection
3)Stored in boostrap/app.php -->
$app->get('/', function (){
return view('home');
});
4) localhost:8000/ return this error -->
Whoops, looks like something went wrong.
2/2 ErrorException in FileViewFinder.php line 137: View [layouts.default] not found. (View: /home/vagrant/lumen/resources/views/home.blade.php)
in FileViewFinder.php line 137
at CompilerEngine->handleViewException(object(InvalidArgumentException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('/home/vagrant/lumen/storage/framework/views/96985f6d91158d600b1d1b64b5a3060d84415fda.php', array('__env' => object(Factory), 'app' => object(Application))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/vagrant/lumen/resources/views/home.blade.php', array('__env' => object(Factory), 'app' => object(Application))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 199
at Response->__construct(object(View)) in RoutesRequests.php line 643
at Application->prepareResponse(object(View)) in RoutesRequests.php line 505
at Application->callActionOnArrayBasedRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 479
at Application->handleFoundRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 376
at Application->Laravel\Lumen\Concerns\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in CorsMiddleware.php line 6
at CorsMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CorsMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in RoutesRequests.php line 626
at Application->sendThroughPipeline(array('App\Http\Middleware\CorsMiddleware'), object(Closure)) in RoutesRequests.php line 382
at Application->dispatch(null) in RoutesRequests.php line 327
at Application->run() in index.php line 28
1/2 InvalidArgumentException in FileViewFinder.php line 137: View [layouts.default] not found.
in FileViewFinder.php line 137
at FileViewFinder->findInPaths('layouts.default', array('/home/vagrant/lumen/resources/views')) in FileViewFinder.php line 79
at FileViewFinder->find('layouts.default') in Factory.php line 165
at Factory->make('layouts.default', array('obLevel' => '1', '__env' => object(Factory), 'app' => object(Application))) in 96985f6d91158d600b1d1b64b5a3060d84415fda.php line 4
at include('/home/vagrant/lumen/storage/framework/views/96985f6d91158d600b1d1b64b5a3060d84415fda.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('/home/vagrant/lumen/storage/framework/views/96985f6d91158d600b1d1b64b5a3060d84415fda.php', array('__env' => object(Factory), 'app' => object(Application))) in CompilerEngine.php line 59
at CompilerEngine->get('/home/vagrant/lumen/resources/views/home.blade.php', array('__env' => object(Factory), 'app' => object(Application))) in View.php line 149
at View->getContents() in View.php line 120
at View->renderContents() in View.php line 85
at View->render() in Response.php line 53
at Response->setContent(object(View)) in Response.php line 199
at Response->__construct(object(View)) in RoutesRequests.php line 643
at Application->prepareResponse(object(View)) in RoutesRequests.php line 505
at Application->callActionOnArrayBasedRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 479
at Application->handleFoundRoute(array(true, array(object(Closure)), array())) in RoutesRequests.php line 376
at Application->Laravel\Lumen\Concerns\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request)) in CorsMiddleware.php line 6
at CorsMiddleware->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CorsMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Laravel\Lumen\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in RoutesRequests.php line 626
at Application->sendThroughPipeline(array('App\Http\Middleware\CorsMiddleware'), object(Closure)) in RoutesRequests.php line 382
at Application->dispatch(null) in RoutesRequests.php line 327
at Application->run() in index.php line 28
The selected answer (https://stackoverflow.com/a/37625344/7506001) is incorrect.
#joeldg and #autista_z are both correct.
As of Lumen 5.4, Blade views are still available and usable, even though they're no longer documented.
Full example:
// In routes/web.php:
$app->get('/', function () use ($app) {
return $app->make('view')->make('home');
});
// In resources/views/default.blade.php:
<html>
<head>...</head>
<body>
<div id="whatever">
#yield('content')
</div>
</body>
</html>
// In resources/views/home.blade.php:
#extends('default')
#section('content')
<p>I am the Home Page!</p>
#endsection
The URL you mention is for Laravel not Lumen, Lumen is a lightweight Laravel, It's for API layer and backend job processing. I recommend Laravel instead.
Function #extends('name') find file "name.blade.php" or "name.php" in the directory "resources/views"
If you use #extends('layouts.default'), it means, it find file file "default.blade.php" or "default.php" in directory "resources/views/layouts" (subfolder layouts in views)
But you have your "deafault.blade.php" in "resources/views"
So it should by #extends('default')
The selected answer is wrong, Lumen has blade installed by default.
The return you are using won't work.
Your route needs to look like
$app->get('/', function () use ($app) {
return $app->make('view')->make('index');
});

ReflectionException in Container.php line 737:

I got this "stacktrace" when trying to display my website. I am new to this, but the error looks to be to something regarding the laravel's system-files?
ReflectionException in Container.php line 737:
Class App\Http\Controllers\HomeController does not exist
in Container.php line 737
at ReflectionClass->__construct('App\Http\Controllers\HomeController') in Container.php line 737
at Container->build('App\Http\Controllers\HomeController', array()) in Container.php line 627
at Container->make('App\Http\Controllers\HomeController', array()) in Application.php line 674
at Application->make('App\Http\Controllers\HomeController') in ControllerDispatcher.php line 85
at ControllerDispatcher- >makeController('App\Http\Controllers\HomeController') in ControllerDispatcher.php line 57
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\HomeController', 'index') in Route.php line 201
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 704
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 706
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 671
at Router->dispatchToRoute(object(Request)) in Router.php line 631
at Router->dispatch(object(Request)) in Kernel.php line 236
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 50
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 122
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87
at Kernel->handle(object(Request)) in index.php line 54
at require_once('/var/www/html/app/public/index.php') in server.php line 21
This is my route.php file.
//(php open tag) Route::get('/', 'HomeController#index');
and my HomeController.php
<?php namespace App\Http\Controllers;
use Illuminate\Routing\Controller;
class HomeController extends Controller {
public function index()
{
return view ('hello');
}
}
And this is my view file hello.php
<doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel 5</title>
</head>
<body>
Welcome to Laravel 5
</body>
</html>
I was getting the same issue for some authentication matter. I get solution by following the 2 steps below:
1. Put "league/oauth2-server": "4.1.*" on the require section of your composer.json file.
2. run 'composer update' command on terminal.
I hope it will help you.
Replace use Illuminate\Routing\Controller; with use App\Http\Controllers\Controller; and also do
composer dump-autoload

Resources