How do I disable Laravel view cache?

Out of the box? You can’t. But you can extend the BladeCompiler class, overriding the method resposible for checking if the view has been expired: class MyBladeCompiler extends BladeCompiler { public function isExpired($path) { if ( ! \Config::get(‘view.cache’)) { return true; } return parent::isExpired($path); } } You’ll need to replace the BladeCompiler instance in IoC … Read more

Laravel: How do I parse this json data in view blade?

It’s pretty easy. First of all send to the view decoded variable (see Laravel Views): view(‘your-view’)->with(‘leads’, json_decode($leads, true)); Then just use common blade constructions (see Laravel Templating): @foreach($leads[‘member’] as $member) Member ID: {{ $member[‘id’] }} Firstname: {{ $member[‘firstName’] }} Lastname: {{ $member[‘lastName’] }} Phone: {{ $member[‘phoneNumber’] }} Owner ID: {{ $member[‘owner’][‘id’] }} Firstname: {{ $member[‘owner’][‘firstName’] … Read more

how to use directive @push in blade template laravel

You just need to make that the opposite way, @push is meant to be in the child view, which is pushing content to the parent @stack directive. So your index.blade.php should have a: @stack(‘custom-scripts’) And your child view: @push(‘custom-scripts’) <script type=”text/javascript” src=”{{ URL::asset (‘js/custom-scripts.js’) }}”></script> @endpush You can also use @parent directive with @section like … Read more