mercredi 27 avril 2016

Laravel 5.2 attempting to bind data to a partial view

I am using using Laravel 5.2 binding data to a partial view. I receive the following error "Object of class Illuminate\View\View could not be converted to int" with this code in the appServiceProvider boot method:

// binding data to a partial view

view()->composer('partials.nav', function($view)
{
$view-with('latest', Article::latest()->first());
});

Any thoughts on how I received this error and how I can solve this problem. Any assistance would be greatly appreciated.I'm at the home stretch of these fundamentals :)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1Su2EKt
via IFTTT

Aucun commentaire:

Enregistrer un commentaire