lumen-generators/lumen-test/clean.sh
Josiah Dahl a2cf22d426 Added Laravel Routes
- New template
- Command updates
2017-08-06 20:54:39 -07:00

52 lines
1018 B
Bash
Executable File

# models
rm app/*.php 2> /dev/null
# migrations
rm database/migrations/*.php 2> /dev/null
# routes
echo "<?php
\$app->get(\"/\", function () use (\$app) {
return \$app->welcome();
});" > app/Http/routes.php
echo "<?php
/*
|------------------------------------------
| ***** DUMMY ROUTES FOR TESTING ONLY *****
|------------------------------------------
*/
" > routes/api.php
# Controllers
rm app/Http/Controllers/*.php 2> /dev/null
echo "<?php
namespace App\Http\Controllers;
use Laravel\Lumen\Routing\Controller as BaseController;
class Controller extends BaseController
{
//
}
" > app/Http/Controllers/Controller.php
# factories
echo "<?php
\$factory->define(App\User::class, function (\$faker) {
return [
'name' => \$faker->name,
'email' => \$faker->email,
'password' => str_random(10),
'remember_token' => str_random(10),
];
});
" > database/factories/ModelFactory.php
# database
rm database/database.sqlite 2> /dev/null
touch database/database.sqlite