Skip to content

Instantly share code, notes, and snippets.

@pravnkay
Created August 3, 2020 15:34
Show Gist options
  • Save pravnkay/98e00eeccb1bba19cf7e91226ff4e557 to your computer and use it in GitHub Desktop.
Save pravnkay/98e00eeccb1bba19cf7e91226ff4e557 to your computer and use it in GitHub Desktop.
Change default directory for Models - Laravel Artisan
<?php
namespace App\Console\Commands;
use Illuminate\Foundation\Console\ModelMakeCommand;
class ModelMake extends ModelMakeCommand
{
/**
* Prefix default root namepsace with a folder.
*
* @param string $rootNamespace
* @return string
*/
protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace.'\\Models';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment