Laravel
Managing User Notification Preferences in Laravel: JSON vs Pivot Table
Managing User Notification Preferences in Laravel: JSON vs Pivot Table Managing user notification preferences is a common feature in applications where users need to subscribe or unsubscribe to various notifications. In Laravel, you have two main approaches for handling this: Storing preferences directly in a JSON column. Using a pivot[...]
Eloquent: Getting Started
Eloquent, an Object-Relational Mapper (ORM) simplifies database interactions. When using Eloquent, each database table has its own "Model" that is used to communicate with it. Eloquent models allow you to insert, update, remove and retrieve records from the database table. Before you start, make sure to include a database connection[...]
Essential Laravel Packages for Streamlined Development
Activity Logging with spatie/laravel-activitylog Package: spatie/laravel-activitylog Version: ^4.7 Activity logging is crucial for auditing and debugging applications. The spatie/laravel-activitylog package provides a straightforward way to log changes to Eloquent models. By tracking actions such as updates, deletions, and creations, this package enables developers to maintain a clear record of changes[...]
Testing: Getting Started
Introduction Testing in Laravel is a fundamental part of the framework, emphasizing the importance of having a robust set of tests that ensure your application functions as expected before it goes into production. Laravel provides a rich set of tools and helpers to facilitate both unit and feature testing, making[...]
CSRF Protection in Laravel
CSRF stands for Cross-Site Request Forgery. It is a security vulnerability that occurs when an attacker tricks a user into performing actions on a website without the user's knowledge or consent. CSRF attacks are possible when a web application does not properly validate or authenticate requests. How CSRF Attacks Work[...]
Laravel Notifications
Typically, notifications should be short, informational messages that notify users of something that occurred in your application. For example, if you are writing a billing application, you might send an "Invoice Paid" notification to your users via the email and SMS channels. Generating Notifications php artisan make:notification InvoicePaid Sending Notifications[...]
Laravel Artisan Console Commands
Artisan is the command-line interface included with Laravel. It provides a number of helpful commands that can assist you while you build your application. To view a list of all available Artisan commands , you may use the list command: Laravel create controller php artisan make:controller UserController php artisan make:controller[...]
Laravel: Factories and seeders
Factories and Seeders are used for generating fake dummy data in Laravel. Laravel includes a simple method of seeding your database with test data using seed classes. All seed classes are stored in the database/seeds directory. Seed classes may have any name you wish, but probably should follow some sensible[...]
Laravel: Getting Start
What is Laravel? Laravel is a free, open-source PHP framework, created by Taylor Otwell and intended for the development of web applications following the Model View Controller (MVC) architectural pattern and it is based on Symfony. The latest stable release of Laravel is Version 11. Why Laravel? It's a popular[...]