Skip to main content

Posts

Showing posts with the label create custom namespace in laravel 8

Laravel 8 Create Custom Namespace Tutorial

Hi Dev, In this post,I will give you how to create custom namespace in laravel 8. we will show example of laravel 8 create custom namespace. laravel 8 namespaces are defined as a class of elements in which each element has a unique name to the associated class. the namespaces may be shared with elements in other classes. let’s understand why we need a namespace in laravel 8. Here, I will give you full example for laravel 8 create custom namespace as bellow. Create Custom Namespace in Laravel 8 I will create a custom namespace in Laravel 8, create a separate controller with forward-slash(/) using the following command. php artisan make:controller Client/UserController --resource --model=User If you closely look at the above command, you can see that we have used the forward slash to separate our namespace Client. This gives us the ability to create a custom namespace, and it is easier for us to design the project. The UserController will be created inside the Client directory insi