Home » Laravel

Tag Archives: Laravel

Laravel: Eloquent Sort By Relation

In Laravel 5.7, we have the Eloquent ORM to help with fetching data. However, sometimes we want to sort the data by a field in a related model and still retain the nested object structure of relations. public function getPrograms(Request $request, $id) { $limit = $request->limit ?? 15; $programs = SchedulePrograms::where('schedule_id', $id) ->with('program') ->orderBy('long_name', 'asc') // throws error ->paginate($limit); return ...

Read More »

Laravel and Dusk on Codeship

Some time back, I posted on how to set up Laravel and Behat using Selenium and headless Chrome. But since that article, a new option has come into view — Dusk. This has several advantages over Behat. For one, the install is greatly simplified. On top of that, the speeds and simplicity in testing the UI and JavaScript have all ...

Read More »

Developing a CI Process for Laravel with Codeship and Forge

Codeship empowers developers to efficiently test and deploy web applications with a basic command. Today, I want to demonstrate some of the platform’s features through testing and deploying a Laravel application. To go through this tutorial, you’re going to need a few things: A local instance of Docker Community Edition A Codeship account A Laravel Forge account – requires subscription ...

Read More »

Laravel and Behat Using Selenium and Headless Chrome

Let’s take a look at using Codeship for Selenium and Headless Chrome testing, which is key for interacting with JavaScript features on your site. I also want to show you how to troubleshoot those rare moments when there’s an issue on the CI but not on your local build, by using Codeship’s SSH feature and Sauce Lab’s remote connections. You ...

Read More »

Getting Started With Laravel On Codeship

Laravel is one of, if not the most popular framework around for PHP today. Using GitHub as my source of truth, Laravel has 24,543 stars, 690 of which it has received this month alone. This is admittedly a simplistic, dare I say even rudimentary, measure of success or quality. But it does show both inertia and uptake. Given this inertia ...

Read More »