diff --git a/app/templates/laravel/app/Http/Requests/__name__StoreRequest.php.txt b/app/templates/laravel/app/Http/Requests/__name__StoreRequest.php.txt index 5a4dfc1..28e6d96 100644 --- a/app/templates/laravel/app/Http/Requests/__name__StoreRequest.php.txt +++ b/app/templates/laravel/app/Http/Requests/__name__StoreRequest.php.txt @@ -13,7 +13,7 @@ class <%= namePascal %>StoreRequest extends CoreRequest */ protected function prepareForValidation() { - return $this->replace([ + return $this->merge([ // ]); } diff --git a/app/templates/laravel/app/Http/Requests/__name__UpdateRequest.php.txt b/app/templates/laravel/app/Http/Requests/__name__UpdateRequest.php.txt index 8eb51c4..3059095 100644 --- a/app/templates/laravel/app/Http/Requests/__name__UpdateRequest.php.txt +++ b/app/templates/laravel/app/Http/Requests/__name__UpdateRequest.php.txt @@ -13,7 +13,7 @@ class <%= namePascal %>UpdateRequest extends CoreRequest */ protected function prepareForValidation() { - return $this->replace([ + return $this->merge([ // ]); } diff --git a/app/templates/laravel/app/Http/Resources/__name__Resource.php.txt b/app/templates/laravel/app/Http/Resources/__name__Resource.php.txt index b806568..d164190 100644 --- a/app/templates/laravel/app/Http/Resources/__name__Resource.php.txt +++ b/app/templates/laravel/app/Http/Resources/__name__Resource.php.txt @@ -14,8 +14,6 @@ class <%= namePascal %>Resource extends JsonResource */ public function toArray($request) { - return [ - // - ]; + return parent::toArray($request); } } diff --git a/app/templates/laravel/app/Repositories/__name__Repository.php.txt b/app/templates/laravel/app/Repositories/__name__Repository.php.txt index 88b8057..e8b3513 100644 --- a/app/templates/laravel/app/Repositories/__name__Repository.php.txt +++ b/app/templates/laravel/app/Repositories/__name__Repository.php.txt @@ -23,7 +23,7 @@ class <%= namePascal %>Repository extends CoreRepository * Allowed model columns to use in sort * @var array */ - protected $allow_order = array('created_at'); + protected $allow_order = array('created_at','updated_at'); /** * Allowed model columns to use in query search @@ -35,7 +35,7 @@ class <%= namePascal %>Repository extends CoreRepository * Allowed model columns to use in filter by date * @var array */ - protected $allow_between_dates = array('created_at'); + protected $allow_between_dates = array('created_at','updated_at'); /** * Allowed model columns to use in filter by value diff --git a/app/templates/laravel/database/seeders/__name__Seeder.php.txt b/app/templates/laravel/database/seeders/__name__Seeder.php.txt index 91a1a36..a688e6b 100644 --- a/app/templates/laravel/database/seeders/__name__Seeder.php.txt +++ b/app/templates/laravel/database/seeders/__name__Seeder.php.txt @@ -4,6 +4,7 @@ namespace Database\Seeders; use App\Models\<%= namePascal %>; use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\App; class <%= namePascal %>Seeder extends Seeder { @@ -14,6 +15,8 @@ class <%= namePascal %>Seeder extends Seeder */ public function run() { - <%= namePascal %>::factory(1)->create(); + if (App::environment('local')) { + <%= namePascal %>::factory(1)->create(); + } } } diff --git a/package.json b/package.json index 31111dd..6da3fc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-secjs", - "version": "1.2.8", + "version": "1.2.9", "description": "🧬 Generator for any NodeJS Project or Framework", "main": "app/index.js", "scripts": {