One-to-many relationship in Laravel 9

In this article we’ll learn how to define models / tables in Laravel 9 with one-to-many relationship, one of the most common relationships between tables in a database. Then we’ll seed some data into these related tables and check the relationship functions. Laravel 9.x requires a minimum PHP version of 8.0. This tutorial assumes that … Read more

Laravel 9 CRUD app using Splade

In Laravel landscape, Blade templating engine has been the tool of choice when it comes to developing frontends of traditional webapps. However, with the explosion of Single Page Applications (SPAs) more and more options came into play in Laravel frontend development; people have been coming up with a number of smart solutions like Livewire, Inertia.js … Read more

Recursive relationship in Laravel 9 VILT app and Ant Design Vue Tree component

In this tutorial we’ll learn how to handle recursive relationship within database table in a Laravel 9 app. Recursive relationship occurs when a database table has self-referencing foreign key i.e., a record maintains referential integrity using the id of another record within the same table; database tables of categories, directories or staff hierarchy usually have … Read more

Ant Design Vue datatable in Laravel 9 VILT app

In this tutorial we’ll embed datatable functionality in a Laravel 9 VILT app using Ant Design Vue Table component. To achieve full optimization, sorting and pagination will be done at client-side while searching will be routed to server-side through Inertia.js in order to always have updated data. Laravel 9.x requires a minimum PHP version of … Read more

Ant Design Vue multiselect in Laravel 9 VILT app

In this tutorial we’ll embed multiselect functionality in a Laravel 9 VILT app using Ant Design Vue select component. Laravel 9.x requires a minimum PHP version of 8.0. This tutorial assumes that you are using Linux, macOS or WSL on Windows and Node.js, Composer and PHP 8 along with required modules i.e bcmatch, sqlite, mbstring, … Read more

Ant Design Vue components in Laravel 9 VILT app

In previous tutorial we built a Vue3 based datatable from scratch within a Laravel 9 VILT (Vue Inertia Laravel Tailwind) app. For learning and basic usage purposes that datatable is fine; however, when we seek productivity, robustness and enterprise-grade look and feel we usually need professionally developed UI components. There are numerous Vue UI kits … Read more

Data-table using Vue3 Composition API in Laravel 9 app

In this tutorial we’ll build a data-table in a Laravel 9 app employing VILT (Vue, Inertia, Laravel, Tailwind) stack while using Composition API of Vue3. The data-table will have the field-based searching capability along with pagination and sorting. Laravel 9.x requires a minimum PHP version of 8.0. This tutorial assumes that you are using Linux, … Read more

Middleware and Component in Laravel app

Middleware and component are two handy tricks in Laravel to break down coding in simple re-useable chucks of code. ‘Middleware’ belongs to back-end side whereas ‘component’ is related to front-end side. As we have UI components like button, message pop-up, modal etc. which can be reused anywhere in layout, middleware represents a chunk of re-useable … Read more

Simple user roles in Laravel app

It’s a common requirement for web-apps to have some kind of user roles defined. Although there are purpose-built packages for incorporating roles and permissions in Laravel app (e.g. Spatie Laravel-permission), however, in most of the cases the user roles requirement is as simple as categorizing users in different groups such as Admin, Manager, User etc. … Read more

Using through() function in Laravel to manipulate collection

In this tutorial we’ll look into through() function for manipulating data inside Laravel collection. As we’ve seen in previous article that map() and filter() are two important functions which are used to manipulate and filter data of a collection. However, these functions return Collection type and Collection does not have paginate() function (well, we need … Read more