By John Koster
The app:name command can be used to set the application namespace. It accepts only one argument, the new name of the application namespace. In a new Laravel installation, the application namespace is set to App, as can be seen in the following code snippet (both PHP code examples will use the contents of the default file app/Http/Controllers/Controller.php):
1<?php
2
3namespace App\Http\Controllers;
4
5// Rest of file contents omitted.
After running the following artisan command:
1php artisan app:name LaravelArtisan
the file changes to the following (note the namespace changes):
1<?php
2
3namespace LaravelArtisan\Http\Controllers;
4
5// Rest of file contents omitted.
∎