![]() ![]() Here is how to do that.įirst, you can click on the class that you want to import. You could easily type this out, but let’s go ahead and use PHPStorm to automatically import the class for us. This of course is because we have not placed a ‘use’ statement at the top of the file to specify we will be using the Channel model in this class. That is to say, we had to use the full namespace of AppChannel::all() to make the query instead of just Channel::all(). Notice that we used a fully qualified namespace for using the Channel model. There is one last thing we can do to clean up the AppServiceProvider just a little bit more. The code above is making sure that the $channels variable is available anytime it is needed. Once again, if you go ahead and visit all of the different pages on your site, everything works perfect. View::share('channels', AppChannel::all()) ![]() Check out this one liner highlighted below:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |