What do you mean with fresh copy ? If you want to remove all auth you can use php artisan fresh.
[L5] laravel 5.1 fresh command
hi every one laravel 5 it come with scaffold authentication and i see in laravel 5.1 found folder auth in controller but not found any view how can make fresh copy for laravel 5.1
If you wan to add everything you can use bestmomo's package: https://github.com/bestmomo/scafold
For me the command 'artisan scaffold:auth' doesn't work. You can copy these files if you want. https://github.com/laravel/laravel/commit/5e11f87de2c8f9303e6e296d74ec5f7f2093fd9b https://twitter.com/taylorotwell/status/578308929995816960
@nazar1987 You just this code in your Route
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
To see Route use blow code
php artisan route:list
And after that you needs to overwrite some function as you need, you also need to put view file or create the view file !
@lcdss it's easiest to use my package as said @bobbybouwmann
@bestmomo hi php artisan fresh not found in laravel 5.1
@nazar1987 it's odd because FreshCommand class is still in core but not in ArtisanServiceProvider.
@bobbybouwmann no i want delete all Scafold Auth and create custom Auth
It's easy to create this command in app/Console/Commands :
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Console\ConfirmableTrait;
use Symfony\Component\Console\Input\InputOption;
class FreshCommand extends Command
{
use ConfirmableTrait;
/**
* The console command name.
*
* @var string
*/
protected $name = 'fresh';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Remove auth included with the framework';
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
if (!$this->confirmToProceed()) {
return;
}
$files = new Filesystem;
$files->deleteDirectory(app_path('Http/Controllers/Auth'));
$files->delete(base_path('database/migrations/2014_10_12_000000_create_users_table.php'));
$files->delete(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php'));
$this->info('Auth removed! Enjoy your fresh start.');
}
/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],
];
}
}
Set it in Console/Kernel :
protected $commands = [
\App\Console\Commands\FreshCommand::class,
];
Please or to participate in this conversation.