Laravel on Laravel Namespaces

namespaces can be defined as a class of elements in which each element has a unique name to that associated class. it may be shared with elements in other classes.

declaration of namespace

the use keyword allows the developers to shorten the namespace.

use <namespace-name>;

the default namespace used in laravel is app, however a user can change the namespace to match with web application. creating user defined namespace with artisan command is mentioned as follows −

php artisan app:name socialnet

select git

the namespace once created can include various functionalities which can be used in controllers and various classes.