If you’re looking forward to what Laravel 5.3 has to offer then I would definitely recommend that you watch this video of Taylor Otwell which goes into detail on what the latest version has to offer. It is pretty long at 1 hour and 36 minutes, but my gosh is it worth it.
I have started using Laravel’s View Composers which come in handy when you have a navigation bar that constantly needs certain data. For example, you have an ecommerce store and you need to poll how many items a user has in their basket on pretty much every page they move onto, or you need a login/register button when a user isn’t logged in and then a profile options button when they are.
You could be really lazy and add the same code/query into every single controller, which yes, that will work, but then that’s not DRY (Don’t Repeat Yourself). To fix this, we can complete a couple of simple steps and have one bit of code which will constantly be in use every time a certian partial is called.
Just recently at work, I had to change the way my news articles worked. We have a client who has Holiday Homes, and they have news articles per park. When I redeveloped the website in Laravel, I created a one to many relationship based on one park has many news articles.
I’ve been developing a couple of projects which use UTF-8 encoding on my databases, but have found that this has been problematic recently. Mobile phones and tablets now use emoticons which can cause problems for us UTF-8 users.
So how do we fix this issue?
Well let me explain below…
I needed a way to change the sort order of my data inside of an admin interface which I have created. After a little looking around, I found many tutorials which would show how to get this done with JQuery, but wouldn’t show the best way to handle this data (and in my case using Laravel to handle this data)…
For this tutorial, I will show you guys how I managed to create an image uploader for your profile image. This is very similar to how Facebook’s/Twitter’s functionality. First of all, lets create the routes, for this we will need to create a get and post route…