diff --git a/resources/stubs/model.stub b/resources/stubs/model.stub index ad4291b..077d504 100755 --- a/resources/stubs/model.stub +++ b/resources/stubs/model.stub @@ -11,7 +11,6 @@ class DummyClass extends Model // use SoftDeletes; protected $guarded = []; - // imageable polymorphic // public function image() { // return $this->morphOne(Image::class, 'imageable'); @@ -52,9 +51,11 @@ class DummyClass extends Model // } + // feel free to add any query filter as much as you want... + $obj = $obj->paginate($value['paginate'] ?? 10); return $obj; } diff --git a/resources/stubs/request.stub b/resources/stubs/request.stub index c6b7045..1355d93 100755 --- a/resources/stubs/request.stub +++ b/resources/stubs/request.stub @@ -29,6 +29,7 @@ class DummyClass extends FormRequest ]; } + // in case you want to return single line of error instead of array of errors.. protected function formatErrors (Validator $validator) { return ['message' => $validator->errors()->first()];