PHP Use Case: Using the Laravel Framework

Leave your reply

Introduction

Read use cases for Laravel, including when to use Laravel, and what applications can benefit from the platform. Laravel is a free, open-source PHP framework designed for developing web applications using the MVC (model-view-controller) pattern. Laravel has a growing and active user base, and is highly extensible, with an active ecosystem of projects and plug-ins.

Use Case: Web App

The user in the following scenarios is developing a productivity web app, designed to let visitors track their lists of tasks, create sub-lists, and archive completed tasks. To accomplish this, the app will need an authentication framework, a queuing system for visitor alerts, and a MySQL back-end.

Related articles:

Scenario 1: User Authentication

The user wants to allow website visitors to create accounts, and require a log-in to use the application's features.

Laravel is frequently praised for its secure, easy-to-use authentication framework. To enable authentication, the user only needs to run two commands from the command line:

php artisan make:auth

php artisan migrate

After this, the user can visit http://example.com/register and verify that the authentication framework is in place.

Related articles:

Scenario 2: Queuing Alerts

The user's application includes automated messages which are sent to the website users to alert them when a task is due. In this stage of development, the user needs to create a queuing system for these alerts. This system will ensure the timely processing of alerts sent to the website alerts, without overwhelming the system or causing the website response times to slow.

Laravel includes a robust queuing system which can be easily implemented, including drivers to interact with MySQL or Redis. Available queue management tools include dispatch delaying, job chaining, rate limiting, setting queue priorities, and more.

Related articles:

Scenario 3: Using Laravel to Interact with MySQL

The user has decided to use MySQL for the web application back-end. The database will need to store website users' to-do lists and sub-lists, and include triggers for notifying users when a task is due.

Laravel's Eloquent ORM makes it simple to work with MySQL. Eloquent syntax is easy to use and understand, from basic CRUD (Create, Read, Update, Delete) functions, to complex topics like advanced querying and polymorphic relationships.

Related articles: