@@ -61,7 +61,7 @@ protected function populateStub(string $stub, Model $model)
61
61
return $ stub ;
62
62
}
63
63
64
- private function buildClassPhpDoc (Model $ model )
64
+ protected function buildClassPhpDoc (Model $ model )
65
65
{
66
66
if (! config ('blueprint.generate_phpdocs ' )) {
67
67
return '' ;
@@ -93,7 +93,7 @@ private function buildClassPhpDoc(Model $model)
93
93
return $ phpDoc ;
94
94
}
95
95
96
- private function buildProperties (Model $ model )
96
+ protected function buildProperties (Model $ model )
97
97
{
98
98
$ properties = '' ;
99
99
@@ -130,7 +130,7 @@ private function buildProperties(Model $model)
130
130
return trim ($ properties );
131
131
}
132
132
133
- private function buildRelationships (Model $ model )
133
+ protected function buildRelationships (Model $ model )
134
134
{
135
135
$ methods = '' ;
136
136
$ template = $ this ->files ->stub ('model/method.stub ' );
@@ -205,6 +205,18 @@ protected function getPath(Model $model)
205
205
return Blueprint::appPath ().'/ ' .$ path .'.php ' ;
206
206
}
207
207
208
+ protected function addTraits (Model $ model , $ stub )
209
+ {
210
+ if (!$ model ->usesSoftDeletes ()) {
211
+ return $ stub ;
212
+ }
213
+
214
+ $ stub = str_replace ('use Illuminate \\Database \\Eloquent \\Model; ' , 'use Illuminate \\Database \\Eloquent \\Model; ' . PHP_EOL . 'use Illuminate \\Database \\Eloquent \\SoftDeletes; ' , $ stub );
215
+ $ stub = Str::replaceFirst ('{ ' , '{ ' . PHP_EOL . ' use SoftDeletes; ' . PHP_EOL , $ stub );
216
+
217
+ return $ stub ;
218
+ }
219
+
208
220
private function fillableColumns (array $ columns )
209
221
{
210
222
return array_diff (array_keys ($ columns ), [
@@ -283,18 +295,6 @@ private function pretty_print_array(array $data, $assoc = true)
283
295
return trim (str_replace ("\n" , PHP_EOL , $ output ));
284
296
}
285
297
286
- private function addTraits (Model $ model , $ stub )
287
- {
288
- if (! $ model ->usesSoftDeletes ()) {
289
- return $ stub ;
290
- }
291
-
292
- $ stub = str_replace ('use Illuminate \\Database \\Eloquent \\Model; ' , 'use Illuminate \\Database \\Eloquent \\Model; ' .PHP_EOL .'use Illuminate \\Database \\Eloquent \\SoftDeletes; ' , $ stub );
293
- $ stub = Str::replaceFirst ('{ ' , '{ ' .PHP_EOL .' use SoftDeletes; ' .PHP_EOL , $ stub );
294
-
295
- return $ stub ;
296
- }
297
-
298
298
private function phpDataType (string $ dataType )
299
299
{
300
300
static $ php_data_types = [
0 commit comments