January, 13, 2019 . 1 min read

How to use Slug in Laravel Factory

Today, I would love to show you a handy trick that, how to use Slug in the Laravel Factory. It's easy that you can call `$faker->sentence` to generate a sentence. However, making slug from that faker sentence is a bit tricky. Imagine that, you have a migration file called **CreatePostsTable** that contains the following field- ```php Sche...

How to use Slug in Laravel Factory

January, 09, 2019 . 6 min read

Building a delighted RESTful API with Laravel

Writing API with [Laravel](https://laravel.com) considering easy, however writing delightful API with Laravel is not that easy. To write a delighted API, you need to have a proper plan for your API. I am planning to share my personal opinion on how to write an incremental API with Laravel. As a consequence, I am going to share you first, how to...

Building a delighted RESTful API with Laravel

December, 30, 2018 . 3 min read

An Introduction to Laravel Policy

If you heard about Laravel Policy and still not yet use that, this introduction to Laravel Policy post is for you then. In this tutorial, I will write a real-life tutorial that, how to use Laravel Policy for the beginner. ## What is Laravel Policy Laravel policy is a part of Authorization of Laravel that help you to protect content or resour...

An Introduction to Laravel Policy

December, 26, 2018 . 4 min read

Deep Diving into Laravel Subquery

In this tutorial, we will learn how to use Laravel Subquery in real life example. I have inspired to write about this article by reading [Jonathan Reinink](https://twitter.com/reinink) [post](https://reinink.ca/articles/dynamic-relationships-in-laravel-using-subqueries). A big clap for him. Imagine that, you have two tables, `users` and `posts`...

Deep Diving into Laravel Subquery

December, 21, 2018 . 2 min read

The Standard Approach to Validate Laravel Form Request

Laravel is one of the best choices for PHP developer since it gives so much flexibility to the developer. However, the form validation is one of the crucial parts for web-based application and API. Laravel makes Validating the request is so simple. We just set the rules and call the validator to check whether the request meets the rules or not. Ret...

The Standard Approach to Validate Laravel Form Request

December, 13, 2018 . 1 min read

How to use Laravel Transform

You will get an example in Laravel documentation that how to use **transform()** in Laravel. You might see example code like that- ``` php $collection = collect([1, 2, 3, 4, 5]); $collection->transform(function ($item, $key) { return $item * 2; }); $collection->all(); // [2, 4, 6, 8, 10] ``` Easy enough, right? However, i...

How to use Laravel Transform

December, 12, 2018 . 1 min read

Laravel Testing: Starting with Laravel feature Testing

Although, there is a lot of controversy for testing in development, however, I would prefer to do follow testing. The advantage of testing laravel application is better than without testing. So, I will write down some continuous post on it. So, today, I will show you how to create a new feature test on laravel application. There are two types o...

Laravel Testing: Starting with Laravel feature Testing

December, 04, 2018 . 1 min read

How to upload laravel project in cPanel

If you use cPanel to host your [Laravel](https://www.laravel.com) application, you might be confusing at first. It's because of the directory structure of Laravel and cPanel are bit different. Today, I would like to share a video that, how to upload laravel project in cpanel. Hope you will enjoy this. [How to upload laravel project in cPanel](h...

How to upload laravel project in cPanel

November, 29, 2018 . 2 min read

Laravel PHP artisan Route List command

Ideally, the ```php artisan route:list``` will display display the domain, method, URI, name, action and middleware for the routes it includes in the generated table. Now, what if I want to show a route list for a particular url, name or method? Well, in this case, we can use some **Term** in Artisan Route List. The syntax of Article Rout...

Laravel PHP artisan Route List command

November, 26, 2018 . 1 min read

Let's do Laravel code refactoring

Sometimes, we have some code that we can do refactor more. In this post I will show you how to do refactor a traditional code and make it more optimized. Let's imagine that, as an author, you have some events. Now you need to show your events like the following code- ```php namespace App\Http\Controllers; use Auth; use App\Event; use Ill...

Let's do Laravel code refactoring