Grafioo School
  • Programming Courses
    • Programming and Artificial Intelligence Secondary 1
  • Learn English
    • Unit 3 (Sample Lesson)
    • Unit 4 (Sample Lesson)
    • Extreme Sports (Sample Lesson)
  • Learn French
    • Conjugations
    • Phrases
  • Learn Deutsch
  • Learn Science
    • Digestive System
    • Respiratory System
    • Circulatory System
    • Urinary System
    • Friction Force
    • Atoms
    • Rays
    • science6
  • About Grafioo
Grafioo School
  • Programming Courses
    • Programming and Artificial Intelligence Secondary 1
  • Learn English
    • Unit 3 (Sample Lesson)
    • Unit 4 (Sample Lesson)
    • Extreme Sports (Sample Lesson)
  • Learn French
    • Conjugations
    • Phrases
  • Learn Deutsch
  • Learn Science
    • Digestive System
    • Respiratory System
    • Circulatory System
    • Urinary System
    • Friction Force
    • Atoms
    • Rays
    • science6
  • About Grafioo

Laravel – Namespaces

  • Routing
  • Middleware
  • Namespaces
  • Controller
  • Views
  • Requests
  • Cookies
  • Blade Templates
  • Redirection
  • Database

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.