From 55d2923e3539fab86c87d830c4a6cecdba1d71f7 Mon Sep 17 00:00:00 2001 From: Ryan Chandler Date: Thu, 11 Mar 2021 22:14:23 +0000 Subject: [PATCH 1/6] feature: add plugin service provider hooks for register --- src/PluginServiceProvider.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/PluginServiceProvider.php b/src/PluginServiceProvider.php index 71bd379baa..23ed85f696 100644 --- a/src/PluginServiceProvider.php +++ b/src/PluginServiceProvider.php @@ -20,6 +20,8 @@ abstract class PluginServiceProvider extends ServiceProvider public function register() { + $this->registeringPlugin(); + $this->app->booting(function () { foreach ($this->pages() as $page) { Filament::registerPage($page); @@ -49,6 +51,8 @@ abstract class PluginServiceProvider extends ServiceProvider Filament::provideToScript($this->scriptData()); }); }); + + $this->pluginRegistered(); } protected function pages() @@ -56,6 +60,16 @@ abstract class PluginServiceProvider extends ServiceProvider return $this->pages; } + protected function pluginRegistered() + { + // + } + + protected function registeringPlugin() + { + // + } + protected function resources() { return $this->resources; From 1c7b888ad5a511a402599419b39581c4afc5d7f4 Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Thu, 11 Mar 2021 23:13:14 +0000 Subject: [PATCH 2/6] feature --- src/Commands/Aliases/MakeColumnCommand.php | 12 ++++ .../Aliases/MakeFormComponentCommand.php | 12 ++++ src/Commands/MakeColumnCommand.php | 71 +++++++++++++++++++ src/Commands/MakeFormComponentCommand.php | 71 +++++++++++++++++++ src/FilamentServiceProvider.php | 10 +-- src/Resources/Forms/Components/Component.php | 8 +++ src/Resources/Forms/Components/Field.php | 8 +++ src/Resources/Tables/Columns/Column.php | 8 +++ stubs/CellView.stub | 3 + stubs/Column.stub | 10 +++ stubs/FormComponent.stub | 10 +++ stubs/FormComponentView.stub | 5 ++ stubs/ResourceColumn.stub | 10 +++ stubs/ResourceField.stub | 2 +- stubs/ResourceFormComponent.stub | 10 +++ 15 files changed, 245 insertions(+), 5 deletions(-) create mode 100644 src/Commands/Aliases/MakeColumnCommand.php create mode 100644 src/Commands/Aliases/MakeFormComponentCommand.php create mode 100644 src/Commands/MakeColumnCommand.php create mode 100644 src/Commands/MakeFormComponentCommand.php create mode 100644 src/Resources/Forms/Components/Component.php create mode 100644 src/Resources/Forms/Components/Field.php create mode 100644 src/Resources/Tables/Columns/Column.php create mode 100644 stubs/CellView.stub create mode 100644 stubs/Column.stub create mode 100644 stubs/FormComponent.stub create mode 100644 stubs/FormComponentView.stub create mode 100644 stubs/ResourceColumn.stub create mode 100644 stubs/ResourceFormComponent.stub diff --git a/src/Commands/Aliases/MakeColumnCommand.php b/src/Commands/Aliases/MakeColumnCommand.php new file mode 100644 index 0000000000..cb2747f782 --- /dev/null +++ b/src/Commands/Aliases/MakeColumnCommand.php @@ -0,0 +1,12 @@ +argument('name')) + ->trim('/') + ->trim('\\') + ->trim(' ') + ->replace('/', '\\'); + $columnClass = (string) Str::of($column)->afterLast('\\'); + $columnNamespace = Str::of($column)->contains('\\') ? + (string) Str::of($column)->beforeLast('\\') : + ''; + + $view = Str::of($column) + ->prepend('filament\\tables\\cells\\') + ->explode('\\') + ->map(fn ($segment) => Str::kebab($segment)) + ->implode('.'); + + $path = app_path( + (string) Str::of($column) + ->prepend($this->option('resource') ? 'Filament\\Resources\\Tables\\Columns\\' : 'Filament\\Tables\\Columns\\') + ->replace('\\', '/') + ->append('.php'), + ); + $viewPath = resource_path( + (string) Str::of($view) + ->replace('.', '/') + ->prepend('views/') + ->append('.blade.php'), + ); + + if ($this->checkForCollision([ + $path, + ])) return; + + if (! $this->option('resource')) { + $this->copyStubToApp('Column', $path, [ + 'class' => $columnClass, + 'namespace' => 'App\\Filament\\Tables\\Columns' . ($columnNamespace !== '' ? "\\{$columnNamespace}" : ''), + 'view' => $view, + ]); + } else { + $this->copyStubToApp('ResourceColumn', $path, [ + 'class' => $columnClass, + 'namespace' => 'App\\Filament\\Resources\\Tables\\Columns' . ($columnNamespace !== '' ? "\\{$columnNamespace}" : ''), + 'view' => $view, + ]); + } + + if (! $this->fileExists($viewPath)) { + $this->copyStubToApp('CellView', $viewPath); + } + + $this->info("Successfully created {$column}!"); + } +} diff --git a/src/Commands/MakeFormComponentCommand.php b/src/Commands/MakeFormComponentCommand.php new file mode 100644 index 0000000000..3ff2ddebca --- /dev/null +++ b/src/Commands/MakeFormComponentCommand.php @@ -0,0 +1,71 @@ +argument('name')) + ->trim('/') + ->trim('\\') + ->trim(' ') + ->replace('/', '\\'); + $componentClass = (string) Str::of($component)->afterLast('\\'); + $componentNamespace = Str::of($component)->contains('\\') ? + (string) Str::of($component)->beforeLast('\\') : + ''; + + $view = Str::of($component) + ->prepend('filament\\forms\\components\\') + ->explode('\\') + ->map(fn ($segment) => Str::kebab($segment)) + ->implode('.'); + + $path = app_path( + (string) Str::of($component) + ->prepend($this->option('resource') ? 'Filament\\Resources\\Forms\\Components\\' : 'Filament\\Forms\\Components\\') + ->replace('\\', '/') + ->append('.php'), + ); + $viewPath = resource_path( + (string) Str::of($view) + ->replace('.', '/') + ->prepend('views/') + ->append('.blade.php'), + ); + + if ($this->checkForCollision([ + $path, + ])) return; + + if (! $this->option('resource')) { + $this->copyStubToApp('FormComponent', $path, [ + 'class' => $componentClass, + 'namespace' => 'App\\Filament\\Forms\\Components' . ($componentNamespace !== '' ? "\\{$componentNamespace}" : ''), + 'view' => $view, + ]); + } else { + $this->copyStubToApp('ResourceFormComponent', $path, [ + 'class' => $componentClass, + 'namespace' => 'App\\Filament\\Resources\\Forms\\Components' . ($componentNamespace !== '' ? "\\{$componentNamespace}" : ''), + 'view' => $view, + ]); + } + + if (! $this->fileExists($viewPath)) { + $this->copyStubToApp('FormComponentView', $viewPath); + } + + $this->info("Successfully created {$component}!"); + } +} diff --git a/src/FilamentServiceProvider.php b/src/FilamentServiceProvider.php index 97a680152b..6399374a54 100644 --- a/src/FilamentServiceProvider.php +++ b/src/FilamentServiceProvider.php @@ -58,15 +58,17 @@ class FilamentServiceProvider extends ServiceProvider } $this->commands($commands = [ + Commands\MakeColumnCommand::class, + Commands\MakeFieldCommand::class, + Commands\MakeFilterCommand::class, + Commands\MakeFormComponentCommand::class, + Commands\MakePageCommand::class, Commands\MakeRelationManagerCommand::class, Commands\MakeResourceCommand::class, Commands\MakeRoleCommand::class, - Commands\MakePageCommand::class, + Commands\MakeThemeCommand::class, Commands\MakeUserCommand::class, Commands\MakeWidgetCommand::class, - Commands\MakeFieldCommand::class, - Commands\MakeThemeCommand::class, - Commands\MakeFilterCommand::class, ]); $aliases = []; diff --git a/src/Resources/Forms/Components/Component.php b/src/Resources/Forms/Components/Component.php new file mode 100644 index 0000000000..dbe88308b5 --- /dev/null +++ b/src/Resources/Forms/Components/Component.php @@ -0,0 +1,8 @@ + + {{ $column->getValue($record) }} + diff --git a/stubs/Column.stub b/stubs/Column.stub new file mode 100644 index 0000000000..34ee4c6aa1 --- /dev/null +++ b/stubs/Column.stub @@ -0,0 +1,10 @@ +getId() }}" +> + {{-- Form component content --}} + diff --git a/stubs/ResourceColumn.stub b/stubs/ResourceColumn.stub new file mode 100644 index 0000000000..66ff45efd6 --- /dev/null +++ b/stubs/ResourceColumn.stub @@ -0,0 +1,10 @@ + Date: Thu, 11 Mar 2021 23:19:04 +0000 Subject: [PATCH 3/6] add hidden props --- src/Commands/Aliases/MakeFilterCommand.php | 2 ++ src/Commands/Aliases/MakeThemeCommand.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Commands/Aliases/MakeFilterCommand.php b/src/Commands/Aliases/MakeFilterCommand.php index 570482bc13..dff59a6524 100644 --- a/src/Commands/Aliases/MakeFilterCommand.php +++ b/src/Commands/Aliases/MakeFilterCommand.php @@ -5,4 +5,6 @@ namespace Filament\Commands\Aliases; class MakeFilterCommand extends \Filament\Commands\MakeFilterCommand { protected $signature = 'filament:filter {name} {--R|resource}'; + + protected $hidden = true; } diff --git a/src/Commands/Aliases/MakeThemeCommand.php b/src/Commands/Aliases/MakeThemeCommand.php index ee593e2d5f..f3015701d3 100644 --- a/src/Commands/Aliases/MakeThemeCommand.php +++ b/src/Commands/Aliases/MakeThemeCommand.php @@ -5,4 +5,6 @@ namespace Filament\Commands\Aliases; class MakeThemeCommand extends \Filament\Commands\MakeThemeCommand { protected $signature = 'filament:theme {name}'; + + protected $hidden = true; } From 4bf67486db59837756cba57d78effba861b43a60 Mon Sep 17 00:00:00 2001 From: Hussein Hussein Date: Fri, 12 Mar 2021 01:54:38 +0200 Subject: [PATCH 4/6] add Arabic(ar) language translations --- resources/lang/ar/auth/login.php | 37 +++++ resources/lang/ar/auth/logout.php | 9 ++ resources/lang/ar/auth/request-password.php | 36 +++++ resources/lang/ar/auth/reset-password.php | 41 ++++++ resources/lang/ar/dashboard.php | 41 ++++++ resources/lang/ar/edit-account.php | 19 +++ resources/lang/ar/nav.php | 17 +++ .../lang/ar/resources/pages/create-record.php | 13 ++ .../lang/ar/resources/pages/edit-record.php | 45 ++++++ .../lang/ar/resources/pages/list-records.php | 25 ++++ .../lang/ar/resources/relation-manager.php | 131 ++++++++++++++++++ resources/lang/ar/resources/user-resource.php | 84 +++++++++++ 12 files changed, 498 insertions(+) create mode 100644 resources/lang/ar/auth/login.php create mode 100644 resources/lang/ar/auth/logout.php create mode 100644 resources/lang/ar/auth/request-password.php create mode 100644 resources/lang/ar/auth/reset-password.php create mode 100644 resources/lang/ar/dashboard.php create mode 100644 resources/lang/ar/edit-account.php create mode 100644 resources/lang/ar/nav.php create mode 100644 resources/lang/ar/resources/pages/create-record.php create mode 100644 resources/lang/ar/resources/pages/edit-record.php create mode 100644 resources/lang/ar/resources/pages/list-records.php create mode 100644 resources/lang/ar/resources/relation-manager.php create mode 100644 resources/lang/ar/resources/user-resource.php diff --git a/resources/lang/ar/auth/login.php b/resources/lang/ar/auth/login.php new file mode 100644 index 0000000000..3de66458fc --- /dev/null +++ b/resources/lang/ar/auth/login.php @@ -0,0 +1,37 @@ + [ + + 'submit' => [ + 'label' => 'تسجيل الدخول', + ], + + ], + + 'form' => [ + + 'email' => [ + 'label' => 'البريد الإلكتروني', + ], + + 'password' => [ + 'hint' => 'نسيت كلمة المرور؟', + 'label' => 'كلمة المرور', + ], + + 'remember' => [ + 'label' => 'تذكرني', + ], + + ], + + 'messages' => [ + 'failed' => 'بيانات الاعتماد هذه غير متطابقة مع البيانات المسجلة لدينا.', + 'throttled' => 'عدد كبير جدا من محاولات الدخول. يرجى المحاولة مرة أخرى بعد :seconds ثانية.', + ], + + 'title' => 'تسجيل الدخول إلى حسابك', + +]; diff --git a/resources/lang/ar/auth/logout.php b/resources/lang/ar/auth/logout.php new file mode 100644 index 0000000000..5aa4c285f0 --- /dev/null +++ b/resources/lang/ar/auth/logout.php @@ -0,0 +1,9 @@ + [ + 'label' => 'خروج', + ], + +]; diff --git a/resources/lang/ar/auth/request-password.php b/resources/lang/ar/auth/request-password.php new file mode 100644 index 0000000000..a21ba2beb2 --- /dev/null +++ b/resources/lang/ar/auth/request-password.php @@ -0,0 +1,36 @@ + [ + + 'submit' => [ + 'label' => 'إرسال رابط إعادة تعيين كلمة المرور', + ], + + ], + + 'form' => [ + + 'email' => [ + 'hint' => 'العودة إلى تسجيل الدخول', + 'label' => 'البريد الإلكتروني', + ], + + ], + + 'messages' => [ + + 'throttled' => 'عدد كبير جدا من محاولات الدخول. يرجى المحاولة مرة أخرى بعد :seconds ثانية.', + + 'passwords' => [ + 'sent' => 'تم إرسال تفاصيل استعادة كلمة المرور الخاصة بك إلى بريدك الإلكتروني!', + 'throttled' => 'الرجاء الانتظار قبل إعادة المحاولة.', + 'user' => 'لم يتم العثور على أيّ حسابٍ بهذا العنوان الإلكتروني.', + ], + + ], + + 'title' => 'إعادة تعيين كلمة المرور', + +]; diff --git a/resources/lang/ar/auth/reset-password.php b/resources/lang/ar/auth/reset-password.php new file mode 100644 index 0000000000..af67225d01 --- /dev/null +++ b/resources/lang/ar/auth/reset-password.php @@ -0,0 +1,41 @@ + [ + + 'submit' => [ + 'label' => 'إعادة تعيين كلمة المرور', + ], + + ], + + 'form' => [ + + 'email' => [ + 'label' => 'البريد الإلكتروني', + ], + + 'password' => [ + 'label' => 'كلمة المرور', + ], + + 'passwordConfirmation' => [ + 'label' => 'تأكيد كلمة المرور', + ], + + ], + + 'messages' => [ + + 'passwords' => [ + 'throttled' => 'الرجاء الانتظار قبل إعادة المحاولة.', + 'token' => 'رمز استعادة كلمة المرور الذي أدخلته غير صحيح.', + 'user' => 'لم يتم العثور على أيّ حسابٍ بهذا العنوان الإلكتروني.', + ], + + ], + + 'title' => 'إعادة تعيين كلمة المرور', + +]; diff --git a/resources/lang/ar/dashboard.php b/resources/lang/ar/dashboard.php new file mode 100644 index 0000000000..1c35935b2f --- /dev/null +++ b/resources/lang/ar/dashboard.php @@ -0,0 +1,41 @@ + 'لوحة التحكم', + + 'widgets' => [ + + 'account' => [ + + 'heading' => 'أهلا بك, :name', + + 'links' => [ + + 'account' => [ + 'label' => 'إدارة حسابك', + ], + + ], + + ], + + 'filament' => [ + + 'links' => [ + + 'documentation' => [ + 'label' => 'تصفح الوثائق', + ], + + 'repository' => [ + 'label' => 'Visit the repository', + ], + + ], + + ], + + ], + +]; diff --git a/resources/lang/ar/edit-account.php b/resources/lang/ar/edit-account.php new file mode 100644 index 0000000000..d9b8d876db --- /dev/null +++ b/resources/lang/ar/edit-account.php @@ -0,0 +1,19 @@ + [ + + 'save' => [ + 'label' => 'حفظ', + ], + + ], + + 'messages' => [ + 'saved' => 'تم الحفظ!', + ], + + 'title' => 'الحساب', + +]; diff --git a/resources/lang/ar/nav.php b/resources/lang/ar/nav.php new file mode 100644 index 0000000000..b4c1167060 --- /dev/null +++ b/resources/lang/ar/nav.php @@ -0,0 +1,17 @@ + [ + + 'account' => [ + 'label' => 'تعديل الحساب', + ], + + 'users' => [ + 'label' => 'إدارة المستخدمين', + ], + + ], + +]; diff --git a/resources/lang/ar/resources/pages/create-record.php b/resources/lang/ar/resources/pages/create-record.php new file mode 100644 index 0000000000..6f222562bc --- /dev/null +++ b/resources/lang/ar/resources/pages/create-record.php @@ -0,0 +1,13 @@ + [ + + 'create' => [ + 'label' => 'إنشاء', + ], + + ], + +]; diff --git a/resources/lang/ar/resources/pages/edit-record.php b/resources/lang/ar/resources/pages/edit-record.php new file mode 100644 index 0000000000..67f9d9de14 --- /dev/null +++ b/resources/lang/ar/resources/pages/edit-record.php @@ -0,0 +1,45 @@ + [ + + 'delete' => [ + 'label' => 'حذف', + ], + + 'save' => [ + 'label' => 'حفظ', + ], + + ], + + 'modals' => [ + + 'delete' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'confirm' => [ + 'label' => 'تأكيد', + ], + + ], + + 'description' => 'هل أنت متأكد أنك تريد حذف هذا السجل؟ لا يمكن التراجع عن هذا الإجراء.', + + 'heading' => 'حذف هذا السجل؟', + + ], + + ], + + 'messages' => [ + 'saved' => 'تم الحفظ!', + ], + +]; diff --git a/resources/lang/ar/resources/pages/list-records.php b/resources/lang/ar/resources/pages/list-records.php new file mode 100644 index 0000000000..889e447977 --- /dev/null +++ b/resources/lang/ar/resources/pages/list-records.php @@ -0,0 +1,25 @@ + [ + + 'create' => [ + 'label' => 'إنشاء', + ], + + ], + + 'table' => [ + + 'recordActions' => [ + + 'edit' => [ + 'label' => 'تعديل', + ], + + ], + + ], + +]; diff --git a/resources/lang/ar/resources/relation-manager.php b/resources/lang/ar/resources/relation-manager.php new file mode 100644 index 0000000000..73f9476412 --- /dev/null +++ b/resources/lang/ar/resources/relation-manager.php @@ -0,0 +1,131 @@ + [ + + 'attach' => [ + 'label' => 'إرفاق موجود', + ], + + 'create' => [ + 'label' => 'جديد', + ], + + 'detach' => [ + 'label' => 'حذف المحدد' + ], + + ], + + 'modals' => [ + + 'attach' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'attach' => [ + 'label' => 'إرفاق', + ], + + 'attachAnother' => [ + 'label' => 'إرفاق وإرفاق آخر', + ], + + ], + + 'form' => [ + + 'related' => [ + 'placeholder' => 'ابدأ الكتابة للبحث ...', + ], + + ], + + 'heading' => 'إرفاق موجود', + + 'messages' => [ + 'attached' => 'تم الإرفاق!', + ], + + ], + + 'create' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'create' => [ + 'label' => 'إنشاء', + ], + + 'createAnother' => [ + 'label' => 'إنشاء وإنشاء آخر', + ], + + ], + + 'heading' => 'إنشاء', + + 'messages' => [ + 'created' => 'تم الإنشاء!', + ], + + ], + + 'detach' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'detach' => [ + 'label' => 'حذف المحدد', + ], + + ], + + 'description' => 'هل أنت متأكد أنك تريد حذف السجلات المختارة؟ لا يمكن التراجع عن هذا الإجراء.', + + 'heading' => 'حذف السجلات المختارة؟', + + 'messages' => [ + 'detached' => 'تم الحذف!', + ], + + ], + + 'edit' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'save' => [ + 'label' => 'حفظ', + ], + + ], + + 'heading' => 'تعديل', + + 'messages' => [ + 'saved' => 'تم الحفظ!', + ], + + ], + + ], + +]; diff --git a/resources/lang/ar/resources/user-resource.php b/resources/lang/ar/resources/user-resource.php new file mode 100644 index 0000000000..fd3ecbeb2c --- /dev/null +++ b/resources/lang/ar/resources/user-resource.php @@ -0,0 +1,84 @@ + [ + + 'avatar' => [ + 'label' => 'الصورة', + ], + + 'email' => [ + 'label' => 'البريد الإلكتروني', + ], + + 'isAdmin' => [ + 'label' => 'مشرف Filament؟', + 'helpMessage' => 'يستطيع مشرفو Filament الوصول إلى جميع مناطق Filament وإدارة المستخدمين الآخرين.', + ], + + 'isUser' => [ + 'label' => 'مستخدم Filament؟', + ], + + 'name' => [ + 'label' => 'الأسم', + ], + + 'password' => [ + + 'fieldset' => [ + + 'label' => [ + 'create' => 'كلمة المرور', + 'edit' => 'تعيين كلمة مرور جديدة', + ], + + ], + + 'fields' => [ + + 'password' => [ + 'label' => 'كلمة المرور', + ], + + 'passwordConfirmation' => [ + 'label' => 'تأكيد كلمة المرور', + ], + + ], + + ], + + 'roles' => [ + 'label' => 'الأدوار', + 'placeholder' => 'إختر دور', + ], + + ], + + 'table' => [ + + 'columns' => [ + + 'email' => [ + 'label' => 'البريد الإلكتروني', + ], + + 'name' => [ + 'label' => 'الاسم', + ], + + ], + + 'filters' => [ + + 'administrators' => [ + 'label' => 'المشرفون', + ], + + ], + + ], + +]; From cf10b3e64c3ec94130c562f8bef8e0415c6d0cfc Mon Sep 17 00:00:00 2001 From: Hussein Hussein Date: Fri, 12 Mar 2021 02:25:22 +0200 Subject: [PATCH 5/6] Added missing Arabic (ar) translations --- packages/forms/resources/lang/ar/fields.php | 88 +++++++++++++++++++ .../tables/resources/lang/ar/pagination.php | 20 +++++ packages/tables/resources/lang/ar/table.php | 57 ++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 packages/forms/resources/lang/ar/fields.php create mode 100644 packages/tables/resources/lang/ar/pagination.php create mode 100644 packages/tables/resources/lang/ar/table.php diff --git a/packages/forms/resources/lang/ar/fields.php b/packages/forms/resources/lang/ar/fields.php new file mode 100644 index 0000000000..9d0695a060 --- /dev/null +++ b/packages/forms/resources/lang/ar/fields.php @@ -0,0 +1,88 @@ + [ + + 'abbreviatedDays' => [ + 'friday' => 'الجمعة', + 'monday' => 'الاثنين', + 'saturday' => 'السبت', + 'sunday' => 'الأحد', + 'thursday' => 'الخميس', + 'tuesday' => 'الثلاثاء', + 'wednesday' => 'الأربعاء', + ], + + 'months' => [ + 'april' => 'أبريل', + 'august' => 'أغسطس', + 'december' => 'ديسمبر', + 'february' => 'فبراير', + 'january' => 'يناير', + 'july' => 'يوليو', + 'june' => 'يونيو', + 'march' => 'مارس', + 'may' => 'مايو', + 'november' => 'نوفمبر', + 'october' => 'أكتوبر', + 'september' => 'سبتمبر', + ], + + ], + + 'multiSelect' => [ + 'emptyOptionsMessage' => 'لا توجد خيارات للاختيار من بينها.', + 'noSearchResultsMessage' => 'لا توجد خيارات تطابق بحثك.', + 'placeholder' => 'إختر خيارًا', + ], + + 'richEditor' => [ + + 'dialogs' => [ + + 'link' => [ + + 'buttons' => [ + 'link' => 'ربط', + 'unlink' => 'فصل', + ], + + 'label' => 'عنوان url', + + 'placeholder' => 'إدخل عنوان url', + + ], + + ], + + 'toolbarButtons' => [ + 'attachFiles' => 'إرفاق ملفات', + 'bold' => 'عريض', + 'bullet' => 'نقاط', + 'code' => 'كود', + 'heading' => 'عنوان', + 'italic' => 'مائل', + 'link' => 'رابط', + 'number' => 'أرقام', + 'quote' => 'اقتباس', + 'redo' => 'إعادة', + 'strike' => 'يتوسطه خط', + 'subheading' => 'عنوان فرعي', + 'title' => 'عنوان', + 'undo' => 'تراجع', + ], + + ], + + 'select' => [ + 'emptyOptionsMessage' => 'ابدأ الكتابة للبحث ...', + 'noSearchResultsMessage' => 'لا توجد خيارات تطابق بحثك.', + 'placeholder' => 'إختر خيارًا', + ], + + 'tags' => [ + 'placeholder' => 'كلمة مفتاحية جديدة', + ], + +]; diff --git a/packages/tables/resources/lang/ar/pagination.php b/packages/tables/resources/lang/ar/pagination.php new file mode 100644 index 0000000000..a069406347 --- /dev/null +++ b/packages/tables/resources/lang/ar/pagination.php @@ -0,0 +1,20 @@ + [ + 'goToPage' => 'انتقل إلى صفحة :page', + 'next' => 'التالي', + 'previous' => 'السابق', + ], + + 'label' => 'التنقل بين الصفحات', + + 'overview' => [ + 'عرض', + 'إلي', + 'من', + 'النتائج', + ], + +]; diff --git a/packages/tables/resources/lang/ar/table.php b/packages/tables/resources/lang/ar/table.php new file mode 100644 index 0000000000..2ca708cd91 --- /dev/null +++ b/packages/tables/resources/lang/ar/table.php @@ -0,0 +1,57 @@ + [ + + 'button' => [ + 'label' => 'حذف المحدد', + ], + + 'modal' => [ + + 'buttons' => [ + + 'cancel' => [ + 'label' => 'إلغاء', + ], + + 'delete' => [ + 'label' => 'حذف المحدد', + ], + + ], + + 'description' => 'هل أنت متأكد أنك تريد حذف السجلات المختارة؟ لا يمكن التراجع عن هذا الإجراء.', + + 'heading' => 'حذف السجلات المحددة؟', + + ], + + ], + + 'filter' => [ + 'placeholder' => 'تصفية', + ], + + 'messages' => [ + 'noRecords' => 'لا توجد سجلات', + ], + + 'pagination' => [ + + 'fields' => [ + + 'recordsPerPage' => [ + 'label' => 'لكل صفحة', + ], + + ], + + ], + + 'search' => [ + 'placeholder' => 'بحث', + ], + +]; From 51895f3d0507d930c874ee17e94da7f745a755cc Mon Sep 17 00:00:00 2001 From: Dan Harrin Date: Fri, 12 Mar 2021 09:58:01 +0000 Subject: [PATCH 6/6] Add edit fill hooks --- src/Resources/Pages/EditRecord.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Resources/Pages/EditRecord.php b/src/Resources/Pages/EditRecord.php index ab697a1015..43556d384c 100644 --- a/src/Resources/Pages/EditRecord.php +++ b/src/Resources/Pages/EditRecord.php @@ -72,11 +72,15 @@ class EditRecord extends Page public function mount($record) { + $this->callHook('beforeFill'); + $model = static::getModel(); $routeKeyName = (new $model())->getRouteKeyName(); $this->record = $model::where($routeKeyName, $record)->firstOrFail(); + + $this->callHook('afterFill'); } public function save()