Tag: laravel

Understand the Laravel Container Concept with Real Life Example

Understand the Laravel Container Concept with Real Life Example and how it's work under the hood.

Write Phpunit Test for Filament PHP Resource

Officially filament php use pest for testing purpose. All the example of it's documentation is depends on PEST which might be bit challenging for developers (like me) those are not used to pest. In this post, I will show you how can you write tests for a resources via phpunit.

Optimize Laravel Queries & Reduce Memory Usage for Faster Performance

Today I will show you how can I optimize Laravel Queries and reduce memory uses to making our application faster. I will use laravel sub-query and database raw query to make such kind of improvements.

Way to reduce email Bounce and Spam number for Newsletter in Laravel

Handling email bounce and spam rate lower is really hard when you manage email newsletter or sign-up for a laravel application. Recently I faced such a challenge to reduce the bounce and spam rate lower. Believe me, it was not easy! I spend some time to do research and found a work around. Today I will show you how I tackled this. This is a findings for my workaround.

Testing Laravel Jobs and email | Laravel Testing

Today I will show you how to test laravel job, email and email content. This must be a fun to confirm the behavior.

How I Improved Laravel Performance - 2453 Queries Down to 4 | Laravel Refactoring

I have a laravel code that actually visualize list of the users who are featured in the platform. Unfortunately this code takes 2453 queries to load this data to the admin user. Today, I will show you how to can improve it from there to only 4.

Optimize Laravel database Query from 2882 to 2 queries only | Laravel Refactoring

Building laravel dashboard will be one of the difficult tasks. The most challenging job for the dashboard is maintaining low amount of database queries, memory uses and processing time. Today, I will show you how to optimize an existing code that has 2882 number of queries for counting some stats and I will achieve the same result with the 2 queries only.

What is Serialization in Laravel

If you somehow wonder what exactly **serialization** which used at many places in laravel, this this post might help you. In this post, I would like to explain you what exactly it with a real life example. Therefore I assume it will be a easy for you to understand.

How to send Email to Subscribers When You Publish a Post on Laravel

Often we write blog post and wish to send email to subscribers automatically right after the publishing the post. This is a really cool feature for laravel blog application. However it might be tricky. In today's blog post, I will show you can build a functionalities to send email to subscribers when you publish a post in laravel 10.

How to build newsletter subscriber system on Laravel 10

In laravel, writing email newsletter section is not easy. In this tutorial, I will show you how to make newsletter section in laravel 10.

Handling rounding millisecond issue with `diffInSeconds()` in Time

The diffInSeconds() function has millisecond rounding issue. This tiny difference has many significant issue in time consuming application. Today I will show you how to solve it.

How to send email in Laravel 10

In this post, I will show you the step-by-step process and send an email from your Laravel 10 applications.

How to deploy Laravel project on cPanel 2023

In this post, I will show you how to upload or deploy a laravel project on cPanel or shared hosting 2023.

What is Data Transfer Object? Why do we use DTO in Laravel?

The very first question comes in my mind is that, what exactly Data Transfer Object?

How to integrate MermaidJs in Laravel Application

I have been using mermaid for a quite long time. Recently I feel interest to integrate mermaid in [Laravel](https://laravel.com), but there is no good tutorial how can you connect Mermaid in your laravel application. Therefore I am planning to write this article.

Laravel scout whereNotNull is not working

If you want to know how to protect API with [Laravel Sanctum](https://laravel.com/docs/9.x/sanctum) by following the TDD

Protecting API with Laravel Sanctum in TDD Approach

If you want to know how to protect API with [Laravel Sanctum](https://laravel.com/docs/9.x/sanctum) by following the TDD

Refactoring Laravel Project | Part 1

Today I am going to share with you a video where I started refactoring a random Laravel project.

How to activate Laravel Horizon on Cloudways

If you are wondering how to activate [Laravel Horizon](https://laravel.com/docs/master/horizon) in [Cloudways](https://www.cloudways.com/), I think these tiny tips will help you. Recently I have faced the issue of how to activate horizon in Cloudways, then I come out with this solution.

How to Mock Http Response in Laravel

The mocking with HTTP response in Laravel might not be easy. Today, I will show you how to mock HTTP response with [Http Fake](https://laravel.com/docs/9.x/mocking).

Laravel Complex Conditional Validator

Imagine that, you have two fields to validate.

Deep Dive into get() method in Laravel Collection

I found **9 Rules** for writing comments on code.

Laravel 8 database factory not found!

For some reason, if you change the model directory in laravel 8, you may face issues with creating the factory. It will show you the following error-

How to install VueJS via Laravel mix on non-laravel project?

If you are curious to know how to use [VueJS](https://vuejs.org/) via [Laravel Mix](https://laravel-mix.com/) on a non-laravel project, then this tutorial will help you to figure it out. FYI, Laravel Mix supports to use on stand-alone projects.

Integrate PayPal Plus on Laravel 8

If you are interested to integrate [PayPal plus](https://developer.paypal.com/docs/integration/paypal-plus/mexico-brazil/paypal-plus-integration-guide-mexico-brazil/) with Laravel 8, this tutorial will help you a lot. Today, I will guide you on how to integrate PayPal Plus with Laravel. Let's get started.

How to Install Horizon in Laravel

If you are curious to know how to install horizon and how to use in on Laravel local application, this post may help you figure it out.

Real life implementation of Manager pattern on Laravel

I was watching a talk by [Yaz Jallad](https://github.com/ninjaparade) about **I'd Like To Speak To Your Manager** on [Laravel Meetup](https://meetup.laravel.com/). He explained the manager pattern in a sublime way. I really love his explanation.

Understanding the ecosystem of Laravel Authentication

If you are facing any issue related with Mixed Content of your laravel project, here could one of the possible solution that recently I faced.

Laravel Mixed Content issue and broken stylesheet

If you are facing any issue related with Mixed Content of your laravel project, here could one of the possible solution that recently I faced.

Laravel set timezone based on user preference

If you wonder how to set timzeone on Laravel based on user's preference, this post may be helpful for you. In this post, I will show you how to change the application timezone based on what user-defined.

How to define Custom Laravel Helper Function

If you are curious to define custom helper function in Laravel, this post will guide you the step by step process that how to create your custom helper function in your laravel application. Out of the box, [Laravel](https://laravel.com/docs/master/helpers) provides you with many useful and handle helpers such as `Str::slug()` or `ucfirst()` or lot more. Let's know about the process.

How to migrate SQL dump file in Laravel DB Seed

Normally we use `db:seed` in Laravel by faker data. However, today, I will show you how to migrate SQL dump file in Laravel DB Seeder.

Video of Laracon Online 2020

The videos of Laracon Online 2020 is open now. If you are interested to watch, feel free to visit the link-

Laravel Code Refactoring using when()

Today, I will show you a code refactoring tricks by using `->when()` to make your code better readable and standard.

Making your first component with Laravel Livewire

Today, I will show you how to make your first component with Laravel Livewire. To do so, you have to make sure that, you have installed livewire on your laravel project.

How to Install Laravel Livewire?

Today, I will show you how to install laravel livewire. Before that, if you are not familiar with Livewire, here is about what exactly the laravel livewire.

The Practical orientation of Laravel Passport and Postman

Today, I will show you practically how to install passport with laravel and then integrate on the [Postman](https://www.postman.com/).

A practical introduction of Laravel Valet

Today, I will try to make your life easier who uses laravel and want to implement a virtual host. In this tutorial, I would love to show you a practical introduction to Laravel Valet. Let's deep driving into it.

Understanding Autoload and Namespace in PHP

If you come across from procedural PHP programming, __autoload__ and __namespace__ kind of confusing naming for you. To make it easier, today, I will take a deep dive into understanding autoload and namespace in PHP.

Laravel increment column and Update Records

Today I saw a code where the programmer wants to update a laravel model at the same time, he wants to increment a column's value. Today, I will show you the easiest way how to increment column and update Laravel records.

laravel tests Invalid argument supplied for foreach()

If you faced the issue with laravel tests Invalid argument supplied for foreach(), this post might be helpful for you. Recently I was trying to test something, where I was facing this issue. I will write the code in details with the scenario, hope it will be helpful for you.

Ignition - A beautiful error page for Laravel Apps

In the local development, we see the Laravel error page a lot. Most probably the countless time in every day.

How to run a specific test in Laravel Dusk?

If you ever stuck how to run a specific test in Laravel Dusk instead of all the test, this post might help you. There are probably two ways to run a specific test in Laravel dusk, by the file location and by using `--filter` keyword. Let's dig into it.

How to add unique email in Laravel Faker

Imagine that, you have a __UserFactory__ in laravel project where the email address is `unique`. In general, you can easily add generate an email with faker like this way.

Laravel Pagination Vs Chunk

Have you ever put together Laravel Pagination and Chunk, then realize how it works? Are they same or there is a difference between them? If same, then what is the purpose of having two different options for achieving the same work, if not, then what are the fundamental difference between them. In this post, I will talk about it.

Eager loading in Laravel query builder

Today, I will show you a trick that might help you to depends on query builder less where you can easily implement eager loading.

Clean Architecture in PHP | Part 1

Suddenly I feel to improve my knowledge about Clean architecture in PHP. As of, I started reading some books, tutorials, and screencasts. There are lots of content around the internet. I plan to write my extractions that I have learned from those sources. Hopefully, it will be helpful for you. Today, I will share in what context clean PHP architecture is suitable for your project.

How to use each function in Laravel

Laravel has a beautiful `each` method that can help you to process a lot of models. Consider that, you have thousands of models, so, don't load them all into memory, but chunk them. Laravel `each` function will help you to figure out in this issue. Let's see how to use each function in Laravel.

Implement the Open Closed Principle in Laravel for Sign Up

In this tutorial, I will show you how to implement the Open Closed Principle in Laravel for Sign up a user. Here my intention is to apply OCP on Sign up so that you can relate it to your real-life scenario.

Avoid inline code and logic | Write Clean Code - Part 2

Today, I am going to show you how to avoid inline code and logic in PHP.

Apply The Open Closed Principle in Laravel | Part 2

In this post, we will learn how to implement the Open-Closed Principle in Laravel.

How to reduce condition from Model | Write Clean Code - Part 2

In this series to tutorials, my plan is to take some real-life code and try to refactor the code as much as I can. Today, I will show you how to reduce unnecessary condition from the Laravel Model.

Laravel Check If Relationship has Loaded or Not

Now, sometimes if you need to check whether the model has loaded the eager loading or not, then you need to check with `relationLoaded()`. Here is how you check this-

Laravel Testing - How to do Login PHP UnitTest

Today, I will show you how to do Login PHP UnitTest with Laravel. This article will cover the login testing part only.

Writing your first PHP Unit Test | Learning PHPUnit - Part 2

Writing your first PHP Unit Test | Learning PHPUnit - Part 2

Learning PHPUnit | Part 1

Learning PHPUnit | Part 1

Apply The Open Closed Principle in Laravel | Part 1

Apply The Open Closed Principle in Laravel | Part 1

How to use dump() on Laravel Collection

How to use dump() on Laravel Collection

Laravel Tumblr API Integration

Laravel Tumblr API Integration

How to add new columns to the existing table in Laravel migration

How to add new columns to the existing table in Laravel migration

Laravel migrate failed to open stream - No such file or directory

Laravel migrate failed to open stream - No such file or directory

How to get all commit list of Github repo

How to get all commit list of Github repo

Laravel Class env does not exist

Laravel Class env does not exist

How do we rewrite Sclrship?

How do we rewrite Sclrship?

Laravel use PUT or PATCH in Postman

Laravel use PUT or PATCH in Postman

How to add extra values in Laravel Request

How to add extra values in Laravel Request

How to use Slug in Laravel Factory

How to use Slug in Laravel Factory

Building a delighted RESTful API with Laravel

Building a delighted RESTful API with Laravel

An Introduction to Laravel Policy

An Introduction to Laravel Policy

Deep Diving into Laravel Sub-query

Deep Diving into Laravel Sub-query

The Standard Approach to Validate Laravel Form Request

The Standard Approach to Validate Laravel Form Request

How to use Laravel Transform

How to use Laravel Transform

Laravel Testing Starting with Laravel feature Testing

Laravel Testing Laravel Testing Starting with Laravel feature Testing

How to upload laravel project in cPanel

How to upload laravel project in cPanel

Laravel PHP artisan Route List command

Laravel PHP artisan Route List command

Let's do Laravel code refactoring

Let's do Laravel code refactoring

Laravel delete files from Public Folder

Laravel delete files from Public Folder

Welcome to Laravel School

Welcome to Laravel School