Skip to content

Commit 3fafeb9

Browse files
committed
Merge branch 'master' of github.com:CrestApps/laravel-code-generator
2 parents bfcb7fb + cb280be commit 3fafeb9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/Traits/GeneratorReplacers.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ protected function replacePrimaryKey(&$stub, $primaryKey)
6666

6767
return $this;
6868
}
69+
6970
/**
7071
* Replace the app_name fo the given stub.
7172
*
@@ -138,18 +139,40 @@ protected function getModelCapName($name)
138139
return ucwords($name);
139140
}
140141

142+
/**
143+
* Gets a model name.
144+
*
145+
* @param string $name
146+
*
147+
* @return string
148+
*/
141149
protected function getModelName($name)
142150
{
143151
return snake_case($name);
144152
}
145153

154+
/**
155+
* Gets a model name in a plural formal.
156+
*
157+
* @param string $name
158+
*
159+
* @return string
160+
*/
146161
protected function getModelPluralName($name)
147162
{
148163
return str_plural(strtolower($name));
149164
}
150165

166+
/**
167+
* Gets a model name in a plural formal "Caps".
168+
*
169+
* @param string $name
170+
*
171+
* @return string
172+
*/
151173
protected function getModelNamePluralCap($name)
152174
{
153175
return ucwords($this->getModelPluralName($name));
154176
}
177+
155178
}

0 commit comments

Comments
 (0)