Category: Code & Development

James Mills > Code & Development

Adding a helpers file in Laravel

Every now and then you will probably find yourself in the need to use a custom function in your Laravel application. I cannot think of one project which I have worked on where I haven’t needed to add a quick and easy custom function. Our controllers don’t contain actions outside of the 7 resource actions […]

Read More

How to set Social Sharing Images

You may have noticed that when you share my blog posts on Social Media and services like Slack, Telegram and WhatsApp etc. you get to see a nice image accompanying the link to the post. Improved CTR These images really help with Click Through Rate (CTR) and I have found that engagement on the shares […]

Read More

How to return JSON from Laravel Form Request validation errors

UPDATE 10th June 2019 : I posted this article on LaravelUK Slack channel and David T gave me some valuable feedback. You can force Laravel to always return only JSON by specifying the Accept header However, there may be instances where you want to force it regardless and the below article demonstrates how to do […]

Read More

Favourite Laravel packages I always install

I thought it might be helpful for me to share a handful of packages which I find myself installing whenever I start a new Laravel application. Let me know if there are any missing! Laravel Debug bar barryvdh/laravel-debugbar (Github / Packagist) Probably the first package I install in every Laravel project is the laravel Debug […]

Read More

Laravel Eloquent relationship query

I am working on a tool at the moment which is built on top of Codebase. I am going to blog later in more detail about this tool. For now, I want to touch on a specific Laravel issue I had yesterday. We also use TeamWeek to plan on a more top level. TeamWeek enables us to […]

Read More

Limit packages to development in Laravel applications

Let’s say you like to use Laravel 4 Generators by Jeffery Way like we do at Clicksco. If you are not familiar with this package then you should head over to Laracasts and watch the free video. You will only be using the generators in development so you don’t really want to have this included on production. Let’s have […]

Read More