diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3e57316 Binary files /dev/null and b/.DS_Store differ diff --git a/Database/.DS_Store b/Database/.DS_Store new file mode 100644 index 0000000..247f21e Binary files /dev/null and b/Database/.DS_Store differ diff --git a/Providers/BaseServiceProvider.php b/Providers/BaseServiceProvider.php index cf6906e..e7d187a 100644 --- a/Providers/BaseServiceProvider.php +++ b/Providers/BaseServiceProvider.php @@ -29,7 +29,6 @@ class BaseServiceProvider extends ServiceProvider */ public function boot() { - VILT::registerMenu(Menu::make('Dashboard')->label('global.dashboard')->icon('bx bx-home')->route('dashboard')->sort(0)); VILT::registerMenu(Menu::make('Profile')->label('global.profile')->icon('bx bxs-user')->key('profile')->route('profile.show')); $this->registerConfig(); $this->loadViewsFrom(module_path($this->moduleName, 'Resources/views'), 'base'); diff --git a/Services/.DS_Store b/Services/.DS_Store new file mode 100644 index 0000000..78d2940 Binary files /dev/null and b/Services/.DS_Store differ diff --git a/Services/Concerns/HasResource.php b/Services/Concerns/HasResource.php new file mode 100644 index 0000000..d35d9da --- /dev/null +++ b/Services/Concerns/HasResource.php @@ -0,0 +1,23 @@ +query(request(), $this->rows, false); + $this->resource = app($resource)->response($this->rows, $data, app($resource)->table); + return $this; + } +} diff --git a/Services/Resource/Concerns/Pages/Create.php b/Services/Resource/Concerns/Pages/Create.php index 9f4b4e5..fd301ef 100644 --- a/Services/Resource/Concerns/Pages/Create.php +++ b/Services/Resource/Concerns/Pages/Create.php @@ -22,7 +22,8 @@ public function create(Request $request): \Inertia\Response $rows = $this->rows(); return Render::make(ucfirst(Str::camel($this->table)).'/Create')->module($this->module)->data([ "rows" => $rows, - "url" => $this->table + "url" => $this->table, + "trans" => $this->loadTranslations() ])->render(); } } diff --git a/Services/Resource/Concerns/Pages/Edit.php b/Services/Resource/Concerns/Pages/Edit.php index dfee977..696ca8a 100644 --- a/Services/Resource/Concerns/Pages/Edit.php +++ b/Services/Resource/Concerns/Pages/Edit.php @@ -99,7 +99,8 @@ public function edit(Request $request, $id): \Inertia\Response return Render::make(ucfirst(Str::camel($this->table)).'/Edit')->module($this->module)->data([ "rows" => $rows, "record" => $record, - "url" => $this->table + "url" => $this->table, + "trans" => $this->loadTranslations() ])->render(); } } diff --git a/Services/Resource/Concerns/Pages/View.php b/Services/Resource/Concerns/Pages/View.php index 77794cc..b60b9ab 100644 --- a/Services/Resource/Concerns/Pages/View.php +++ b/Services/Resource/Concerns/Pages/View.php @@ -98,7 +98,8 @@ public function view(Request $request, $id){ return Render::make(ucfirst(Str::camel($this->table)).'/View')->module($this->module)->data([ "rows" => $rows, "record" => $record, - "url" => $this->table + "url" => $this->table, + "trans" => $this->loadTranslations() ])->render(); } } diff --git a/Services/Resource/Concerns/Process/Media.php b/Services/Resource/Concerns/Process/Media.php index 9804b58..b0640d9 100644 --- a/Services/Resource/Concerns/Process/Media.php +++ b/Services/Resource/Concerns/Process/Media.php @@ -65,7 +65,7 @@ public function processMediaOnUpdate(Request $request, $record): void } } } - else if(empty($request->get($field->name))){ + else if($field->edit && empty($request->get($field->name))){ $record->clearMediaCollection($field->name); } } diff --git a/Services/Rows/RelationManager.php b/Services/Rows/RelationManager.php new file mode 100644 index 0000000..83de62a --- /dev/null +++ b/Services/Rows/RelationManager.php @@ -0,0 +1,22 @@ +name($name); + } +} diff --git a/Tests/.DS_Store b/Tests/.DS_Store new file mode 100644 index 0000000..665082a Binary files /dev/null and b/Tests/.DS_Store differ