Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to share count of things to sidebar in laravel

// in appserviceprovider.php

	View::composer('layouts.admin.menu', function ($view) {
            $contactUsService = new ContactUsService(new ContactUs());
            $contactUsNotReadCount = $contactUsService->readOrNot(0)->count();
            $view->with('contactUsNotReadCount', $contactUsNotReadCount);
        });
 
PREVIOUS NEXT
Tagged: #share #count #sidebar #laravel
ADD COMMENT
Topic
Name
8+7 =