Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

#166 #169

Closed
wants to merge 2 commits into from
Closed

#166 #169

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
5 changes: 3 additions & 2 deletions src/Traits/CommonCommand.php
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ protected function replaceViewNames(&$stub, $viewDirectory, $routesPrefix, array
* @param string $routesPrefix
* @param string $name
*
* @return $this
* @return string
*/
protected function getDotNotationName($viewDirectory, $routesPrefix, $name = 'index')
{
@@ -272,10 +272,11 @@ protected function getDotNotationName($viewDirectory, $routesPrefix, $name = 'in
/**
* Gets the stub file.
*
*@param string $name
* @param string $name
* @param string $template
*
* @return string
* @throws Exception
*/
protected function getStubByName($name, $template = null)
{
8 changes: 4 additions & 4 deletions templates/default/routes.stub
Original file line number Diff line number Diff line change
@@ -2,13 +2,13 @@
->name('[% index_route_name %]');
Route::get('/create','[% controller_name %]@create')
->name('[% create_route_name %]');
Route::get('/show/{[% model_name_singular_variable %]}','[% controller_name %]@show')
Route::get('/{[% model_name_singular_variable %]}/show','[% controller_name %]@show')
->name('[% show_route_name %]')[% route_id_clause %];
Route::get('/{[% model_name_singular_variable %]}/edit','[% controller_name %]@edit')
->name('[% edit_route_name %]')[% route_id_clause %];
Route::post('/', '[% controller_name %]@store')
Route::post('/store', '[% controller_name %]@store')
->name('[% store_route_name %]');
Route::put('[% model_name_snake %]/{[% model_name_singular_variable %]}', '[% controller_name %]@update')
Route::put('/{[% model_name_singular_variable %]}/[% model_name_snake %]/update', '[% controller_name %]@update')
->name('[% update_route_name %]')[% route_id_clause %];
Route::delete('/[% model_name_snake %]/{[% model_name_singular_variable %]}','[% controller_name %]@destroy')
Route::delete('/{[% model_name_singular_variable %]}/[% model_name_snake %]/delete','[% controller_name %]@destroy')
->name('[% destroy_route_name %]')[% route_id_clause %];