dimanche 22 avril 2018

Trouble adding a vendor to Laravel Blade

I'm building a website with a WordPress ecosystem called Roots (Trellis + Bedrock + Sage). The new version of the Theme (Sage 9) uses Laravel 5.6 and Blade.

I've completed half of the beginners course in Laracasts and I think I understand their use of namespacing, aliases etc... However I successfully installed my first Vendor, Laravel Mobile Detect, via $ composer require riverskies/laravel-mobile-detect but I'm unable to use it because - it seems - I'm not including it properly.

In order to begin using it I have to add Riverskies\Laravel\MobileDetect\MobileDetectServiceProvider::class to config/app.php. However, there isn't one in Sage. Instead there is:

  • config/assets.php
  • config/theme.php
  • config/view.php

I assume this is because they're trying to provide more granular configuration files relevant to this theme. But regardless of which file I add it to the Vendors code (below) is not rendering.

Note: I have tried to install several Vendors and have encountered this same issue in each case. So this is not exclusive to the Vendor.

@desktop
  <h1>Test</h1>
@elsedesktop
  <h1>Test2</h1>
@enddesktop`

Due to my beginners knowledge of Laravel: I'm not clear on the possible reasons this wouldn't work apart from the fact it appears to not be making my Vendor's code accessible to my Blade template files.

Can someone help me understand how to properly debug this?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HplqRS
via IFTTT

Aucun commentaire:

Enregistrer un commentaire