using lumen 5.2 with blade template engine? - laravel

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');
});

Related

Class 'Illuminate\Foundation\Auth\User' not found in Lumen 5.6

I'm migrating an API from Laravel 5.6 to Lumen 5.6
My app use a plugin of mine that reference Illuminate\Foundation\Auth\User
but Lumen doesn't seem to have it. Is it normal ?
(1/1) Error
Class 'Illuminate\Foundation\Auth\User' not found
in HasRelationships.php line 656
at Model->newRelatedInstance('Illuminate\\Foundation\\Auth\\User')
in HasRelationships.php line 418
at Model->belongsToMany('Illuminate\\Foundation\\Auth\\User', 'competitor', 'championship_id')
in Championship.php line 87
at Championship->users()
in Builder.php line 546
at Builder->Illuminate\Database\Eloquent\{closure}()
at call_user_func(object(Closure))
in Relation.php line 89
at Relation::noConstraints(object(Closure))
in Builder.php line 550
at Builder->getRelation('users')
in Builder.php line 518
at Builder->eagerLoadRelation(array(object(Championship), object(Championship), object(Championship), object(Championship)), 'users', object(Closure))
in Builder.php line 498
at Builder->eagerLoadRelations(array(object(Championship), object(Championship), object(Championship), object(Championship)))
in Builder.php line 466
at Builder->get(array('*'))
in Relation.php line 154
at Relation->get()
in Relation.php line 143
at Relation->getEager()
in Builder.php line 529
at Builder->eagerLoadRelation(array(object(Tournament)), 'championships', object(Closure))
in Builder.php line 498
at Builder->eagerLoadRelations(array(object(Tournament)))
in Builder.php line 466
at Builder->get(array('*'))
in BuildsQueries.php line 77
at Builder->first()
in CompetitorController.php line 35
at CompetitorController->index('fake-tournoi')
at call_user_func_array(array(object(CompetitorController), 'index'), array('fake-tournoi'))
in BoundMethod.php line 29
at BoundMethod::Illuminate\Container\{closure}()
in BoundMethod.php line 87
at BoundMethod::callBoundMethod(object(Application), array(object(CompetitorController), 'index'), object(Closure))
in BoundMethod.php line 31
at BoundMethod::call(object(Application), array(object(CompetitorController), 'index'), array('slug' => 'fake-tournoi'), null)
in Container.php line 564
at Container->call(array(object(CompetitorController), 'index'), array('slug' => 'fake-tournoi'))
in RoutesRequests.php line 373
at Application->callControllerCallable(array(object(CompetitorController), 'index'), array('slug' => 'fake-tournoi'))
in RoutesRequests.php line 339
at Application->callLumenController(object(CompetitorController), 'index', array(1, array('uses' => 'App\\Http\\Controllers\\CompetitorController#index'), array('slug' => 'fake-tournoi')))
in RoutesRequests.php line 313
at Application->callControllerAction(array(1, array('uses' => 'App\\Http\\Controllers\\CompetitorController#index'), array('slug' => 'fake-tournoi')))
in RoutesRequests.php line 275
at Application->callActionOnArrayBasedRoute(array(1, array('uses' => 'App\\Http\\Controllers\\CompetitorController#index'), array('slug' => 'fake-tournoi')))
in RoutesRequests.php line 260
at Application->handleFoundRoute(array(1, array('uses' => 'App\\Http\\Controllers\\CompetitorController#index'), array('slug' => 'fake-tournoi')))
in RoutesRequests.php line 230
at Application->handleDispatcherResponse(array(1, array('uses' => 'App\\Http\\Controllers\\CompetitorController#index'), array('slug' => 'fake-tournoi')))
in RoutesRequests.php line 164
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 InjectDebugbar.php line 65
at InjectDebugbar->handle(object(Request), object(Closure))
in Pipeline.php line 151
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))
in CorsMiddleware.php line 18
at CorsMiddleware->handle(object(Request), object(Closure))
in Pipeline.php line 151
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))
in Pipeline.php line 104
at Pipeline->then(object(Closure))
in RoutesRequests.php line 410
at Application->sendThroughPipeline(array('App\\Http\\Middleware\\CorsMiddleware', 'Barryvdh\\Debugbar\\Middleware\\InjectDebugbar'), object(Closure))
in RoutesRequests.php line 166
at Application->dispatch(null)
in RoutesRequests.php line 107
at Application->run()
in index.php line 28
at require('/Users/julien/Documents/Proyectos/kz-api/public/index.php')
in server.php line 147
EDIT:
use Illuminate\Foundation\Auth\User;
...
public function users()
{
return $this->belongsToMany(User::class, 'competitor', 'championship_id')
->withPivot('confirmed')
->withTimestamps();
}
If I change Illuminate\Foundation\Auth\User for App\User, it will work, but as this code belongs to a plugin, it is recommended never to make reference to App\User as you never know the namespace of the project in which it will be running
Yes, it is normal. laravel/lumen-framework doesn't pull in laravel/framework it pulls in the submodules from Illuminate, which do not include what is in Illuminate\Foundation.

Laravel ErrorException

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

Maximum function nesting level when not authenticated

From a fresh install on L2, basic auth, no change.
I trying to add some simple route, no auth needed.
Route "/no-auth" works for both logged in and out.
But route "/starter/my-needs", that uses a controller, works only if logged in.
My question is : Why do I get "Maximum function nesting level when not authenticated".
It seems something around the Guest() method turning around...
Here is the controller:
use App\Http\Controllers\Controller;
/**
* FindMyBank path action.
*/
class FindMyBankController extends Controller {
/**
*
* #return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
*/
function showMyNeeds() {
return view('front/findMyBank/FR/myNeeds', array(
));
}//method
}
Here the route :
Route::get('/', function () {
return view('front/welcome/welcome');
});
Route::get('/no-auth', function () {
return view('front/findMyBank/FR/myNeeds', array(
));
});
Route::group(['prefix' => '/starter'], function () {
Route::get('/my-needs', 'FindMyBank\FindMyBankController#showMyNeeds');
});
Route::auth();
Traces:
FatalErrorException in ClassLoader.php line 314:
Maximum function nesting level of '100' reached, aborting!
in ClassLoader.php line 314
at FatalErrorException->__construct() in HandleExceptions.php line 133
at HandleExceptions->fatalExceptionFromError() in HandleExceptions.php line 118
at HandleExceptions->handleShutdown() in HandleExceptions.php line 0
at ClassLoader->loadClass() in ClassLoader.php line 0
at spl_autoload_call() in ClassLoader.php line 22
in ClassLoader.php line 412
at Composer\Autoload\includeFile() in ClassLoader.php line 301
at ClassLoader->loadClass() in ClassLoader.php line 0
at spl_autoload_call() in ClassLoader.php line 12
in ClassLoader.php line 412
at Composer\Autoload\includeFile() in ClassLoader.php line 301
at ClassLoader->loadClass() in ConnectionFactory.php line 0
at spl_autoload_call() in ConnectionFactory.php line 217
at ConnectionFactory->createConnection() in ConnectionFactory.php line 64
at ConnectionFactory->createSingleConnection() in ConnectionFactory.php line 49
at ConnectionFactory->make() in DatabaseManager.php line 176
at DatabaseManager->makeConnection() in DatabaseManager.php line 68
at DatabaseManager->connection() in Model.php line 3293
at Model::resolveConnection() in Model.php line 3259
at Model->getConnection() in Model.php line 1880
at Model->newBaseQueryBuilder() in Model.php line 1853
at Model->newQueryWithoutScopes() in Model.php line 1823
at Model->newQuery() in EloquentUserProvider.php line 47
at EloquentUserProvider->retrieveById() in SessionGuard.php line 132
at SessionGuard->user() in GuardHelpers.php line 49
at SessionGuard->check() in GuardHelpers.php line 59
at SessionGuard->guest() in AuthManager.php line 292
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Auth\AuthManager.php:292}() in AuthManager.php line 292
at AuthManager->__call() in Facade.php line 215
at AuthManager->guest() in Facade.php line 215
at Facade::__callStatic() in 48fdfc9cae67647c36e6877d2cf03c700242912f.php line 56
at Auth::guest() in 48fdfc9cae67647c36e6877d2cf03c700242912f.php line 56
in PhpEngine.php line 42
at PhpEngine->evaluatePath() in CompilerEngine.php line 59
at CompilerEngine->get() 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 a391999563a1000056f17c1ece3bb49d99d7278c.php line 74
in PhpEngine.php line 42
at PhpEngine->evaluatePath() in CompilerEngine.php line 59
at CompilerEngine->get() 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() in Response.php line 201
at Response->__construct() in Router.php line 1085
at Router->prepareResponse() in ControllerDispatcher.php line 95
at ControllerDispatcher->Illuminate\Routing\{closure}() in Pipeline.php line 52
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:52}() in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}() in Pipeline.php line 103
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack() in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch() in Route.php line 174
at Route->runController() in Route.php line 140
at Route->run() in Router.php line 724
at Router->Illuminate\Routing\{closure}() in Pipeline.php line 52
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:52}() in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}() in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in StartSession.php line 64
at StartSession->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in EncryptCookies.php line 59
at EncryptCookies->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in Pipeline.php line 103
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Router.php line 726
at Router->runRouteWithinStack() in Router.php line 699
at Router->dispatchToRoute() in Router.php line 675
at Router->dispatch() in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}() in Pipeline.php line 52
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:52}() in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}() in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle() in Pipeline.php line 136
at call_user_func_array:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:136}() in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline\{closure}() in Pipeline.php line 32
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php:32}() in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}() in Pipeline.php line 103
at call_user_func:{C:\wamp\www\bebankable\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:103}() in Pipeline.php line 103
at Pipeline->then() in Kernel.php line 132
at Kernel->sendRequestThroughRouter() in Kernel.php line 99
at Kernel->handle() in index.php line 54
at {main}() in index.php line 0
It seems to be the basic xdebug default limitation,
[PHP.ini]
xdebug.max_nesting_level = 250
And it's work.

Custom 404 handler Laravel 5.2 with blade

I've created a custom view in the views/errors directory called 404.blade.php per documented in laravel docs Laravel custom http docs , but when I include a master template it throws a ErrorException. If I remove the #extends('master') from the error view and just use custom html it works find. Is there a way to extend or include master template in my error views?
Here's my stack trace.
ErrorException in 6d81dce21d9f786092d4f08b2291187254557680.php line 41:
Trying to get property of non-object (View C:\xampp\htdocs\auto_responder\resources\views\layouts\site_master.blade.php) (View: C:\xampp\htdocs\auto_responder\resources\views\layouts\site_master.blade.php)
in 6d81dce21d9f786092d4f08b2291187254557680.php line 41
at CompilerEngine->handleViewException(object(ErrorException), '1') in PhpEngine.php line 44
at PhpEngine->evaluatePath('C:\xampp\htdocs\auto_responder\storage\framework\views/a853a92ee6 c1570e0a223b96c01698d12a46f009.php', array('__env' => object(Factory), 'app' => object(Application), 'exception' => object(NotFoundHttpException))) in CompilerEngine.php line 59
at CompilerEngine->get('C:\xampp\htdocs\auto_responder\resources\views/errors/404.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'exception' => object(NotFoundHttpException))) 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), '404', array()) in ResponseFactory.php line 57
at ResponseFactory->make(object(View), '404', array()) in ResponseFactory.php line 71
at ResponseFactory->view('errors.404', array('exception' => object(NotFoundHttpException)), '404', array()) in Handler.php line 156
at Handler->renderHttpException(object(NotFoundHttpException)) in Handler.php line 113
at Handler->render(object(Request), object(NotFoundHttpException)) in Handler.php line 48
at Handler->render(object(Request), object(NotFoundHttpException)) in Pipeline.php line 80
at Pipeline->handleException(object(Request), object(NotFoundHttpException)) in Pipeline.php line 54
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
So I guess my question is, is this suppose to be like this, or am I doing something wrong. All my other views work perfectly using the exact same syntax to extend.

Laravel - Routing error

I am a beginner with Laravel (5.2) and so if this is obvious I apolgise. I have an entry in a Post controller to delete an entry which is passed:
public function getDeletePost( $post_id )
{
$post = Post::where('id', $post_id)->first();
$post->delete();
$message = "successfully deleted";
return redirect()->route('dashboard')->with( ['message'=> $message] );
}
which is called from a function in the routes file:
Route::get('/delete-post/{post_id}',
[ 'uses'=> 'PostController#getDeletePost',
'as' => 'post.delete' ]);
The route is called from a page:
delete
The page is showing the correct URL (http://localhost:8000/post-delete/5) but I am getting the following error and cannot seem to get around it:
Sorry, the page you are looking for could not be found.
1/1 NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 823
at Router->findRoute(object(Request)) in Router.php line 691
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
at require_once('D:\websites\__laravel\socialnetwork\public\index.php') in server.php line 21
Yes a typo! I am suitably humbled!

Resources