Skip to content

Commit

Permalink
Merge pull request #3 from shunnmugam/develop
Browse files Browse the repository at this point in the history
Develop
shunnmugam authored Mar 10, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 6dae8cb + 68cde49 commit 4bc10f0
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Generators/FileGenerator.php
Original file line number Diff line number Diff line change
@@ -551,7 +551,7 @@ protected function changeCrudControllerContent($contents) {
if($this->modelname)
$value = $this->modelname;
else
$value = $this->modulename;
$value = $this->modulename."Model";

$contents = $this->changeStrings($contents,'{model}',ucfirst($value));

7 changes: 7 additions & 0 deletions src/Helper.php
Original file line number Diff line number Diff line change
@@ -14,4 +14,11 @@ function skin($url=false)
if($url)
$skin.=$url;
return $skin;
}
/*
* get theme path
*/
function theme_path()
{
return base_path().'/cms/local/'.Cms::getCurrentTheme().'/';
}
2 changes: 2 additions & 0 deletions src/providers/CommandProvider.php
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ class CommandProvider extends ServiceProvider
'Ramesh\Cms\Commands\MakeNotification',
'Ramesh\Cms\Commands\MakeProvider',
'Ramesh\Cms\Commands\MakeSeeder',
'Ramesh\Cms\Commands\MakeCrudRoutes',
'Ramesh\Cms\Commands\MakeCrudViews',

'Ramesh\Cms\Commands\Migrate',
'Ramesh\Cms\Commands\Seed',
4 changes: 2 additions & 2 deletions src/stubs/module/Controllers/ModuleCController.stub
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ class {class} extends Controller
public function store(Request $request)
{
$this->validate($request,[
'name' => 'required|min:3|max:50|unique:tablename,name',
'name' => 'required|min:3|max:50|unique:'.(new {model}())->getTable().',name',
'desc' => 'required|min:3|max:190',
'status' => 'required',
]);
@@ -91,7 +91,7 @@ class {class} extends Controller
public function update(Request $request, $id)
{
$this->validate($request,[
'name' => 'required|min:3|max:50|unique:tablename,name,'.$id,
'name' => 'required|min:3|max:50|unique:'.(new {model}())->getTable().',name,'.$id,
'desc' => 'required|min:3|max:190',
'status' => 'required',
]);

0 comments on commit 4bc10f0

Please sign in to comment.