Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Commands/stubs/composer.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
"extra": {
"laravel": {
"providers": [],
"aliases": {

}
"aliases": {}
}
},
"autoload": {
Expand Down
44 changes: 29 additions & 15 deletions src/Commands/stubs/controller-api.stub
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,62 @@ class $CLASS$ extends Controller
*/
public function index()
{
//

return response()->json([]);
return response()->json([
'status' => 'success',
'data' => [
// 'users' => []
],
]);
}

/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//

return response()->json([]);
return response()->json([
'status' => 'success',
'data' => [
// 'user' => []
],
]);
}

/**
* Show the specified resource.
*/
public function show($id)
{
//

return response()->json([]);
return response()->json([
'status' => 'success',
'data' => [
// 'user' => []
],
]);
}

/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
//

return response()->json([]);
return response()->json([
'status' => 'success',
'data' => [
// 'user' => []
],
]);
}

/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//

return response()->json([]);
return response()->json([
'status' => 'success',
'message' => 'Record deleted successfully.',
// 'data' => [],
]);
}
}
5 changes: 1 addition & 4 deletions src/Commands/stubs/controller.invokable.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ class $CLASS$ extends Controller
/**
* Handle the incoming request.
*/
public function __invoke(Request $request)
{
return response()->json([]);
}
public function __invoke(Request $request) {}
}
15 changes: 3 additions & 12 deletions src/Commands/stubs/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class $CLASS$ extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('$LOWER_NAME$::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class $CLASS$ extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('$LOWER_NAME$::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('$LOWER_NAME$::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/stubs/factory.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace $NAMESPACE$;

use Illuminate\Database\Eloquent\Factories\Factory;
use $MODEL_NAMESPACE$\$NAME$;

class $NAME$Factory extends Factory
{
/**
* The name of the factory's corresponding model.
*/
protected $model = \$MODEL_NAMESPACE$\$NAME$::class;
protected $model = $NAME$::class;

/**
* Define the model's default state.
Expand Down
4 changes: 2 additions & 2 deletions src/Commands/stubs/model.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class $CLASS$ extends Model
*/
protected $fillable = $FILLABLE$;

// protected static function newFactory(): $NAME$Factory
// protected static function newFactory()
// {
// // return $NAME$Factory::new();
// return $NAME$Factory::new();
// }
}
4 changes: 2 additions & 2 deletions src/Commands/stubs/routes/api.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;

Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
Route::apiResource('$PLURAL_LOWER_NAME$', $STUDLY_NAME$Controller::class)->names('$LOWER_NAME$');
Route::middleware(['auth:api'])->prefix('v1')->group(function () {
Route::apiResource('$PLURAL_LOWER_NAME$', $STUDLY_NAME$Controller::class);
});
2 changes: 1 addition & 1 deletion src/Commands/stubs/routes/web.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ use Illuminate\Support\Facades\Route;
use $MODULE_NAMESPACE$\$STUDLY_NAME$\$CONTROLLER_NAMESPACE$\$STUDLY_NAME$Controller;

Route::middleware(['auth', 'verified'])->group(function () {
Route::resource('$PLURAL_LOWER_NAME$', $STUDLY_NAME$Controller::class)->names('$LOWER_NAME$');
Route::resource('$PLURAL_LOWER_NAME$', $STUDLY_NAME$Controller::class);
});
3 changes: 2 additions & 1 deletion src/Commands/stubs/scaffold/provider.stub
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class $CLASS$ extends ServiceProvider

$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->nameLower);

Blade::componentNamespace(config('modules.namespace').'\\' . $this->name . '\\View\\Components', $this->nameLower);
$namespace = $this->module_namespace($this->name, $this->app_path(config('modules.paths.generator.component-class.path')));
Blade::componentNamespace($namespace, $this->nameLower);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class MyController extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('blog::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class MyController extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('blog::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('blog::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class MyController extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('blog::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class MyController extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('blog::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('blog::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class MyController extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('blog::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class MyController extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('blog::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('blog::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class MyController extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('blog::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class MyController extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('blog::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('blog::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ class MyController extends Controller
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('blog::create');
}
public function create() {}

/**
* Store a newly created resource in storage.
Expand All @@ -31,18 +28,12 @@ class MyController extends Controller
/**
* Show the specified resource.
*/
public function show($id)
{
return view('blog::show');
}
public function show($id) {}

/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('blog::edit');
}
public function edit($id) {}

/**
* Update the specified resource in storage.
Expand Down
Loading