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' => 'بحث', + ], + +]; 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' => 'المشرفون', + ], + + ], + + ], + +]; 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/PluginServiceProvider.php b/src/PluginServiceProvider.php index 7c1b7ce02f..7eae2a6bc8 100644 --- a/src/PluginServiceProvider.php +++ b/src/PluginServiceProvider.php @@ -26,6 +26,8 @@ abstract class PluginServiceProvider extends ServiceProvider public function register() { + $this->registeringPlugin(); + $this->app->booting(function () { foreach ($this->pages() as $page) { Filament::registerPage($page); @@ -57,6 +59,8 @@ abstract class PluginServiceProvider extends ServiceProvider Filament::provideToScript($this->scriptData()); }); }); + + $this->pluginRegistered(); } protected function pages() @@ -64,6 +68,16 @@ abstract class PluginServiceProvider extends ServiceProvider return $this->pages; } + protected function pluginRegistered() + { + // + } + + protected function registeringPlugin() + { + // + } + protected function resources() { return $this->resources; 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 @@ +callHook('beforeFill'); + $model = static::getModel(); $routeKeyName = (new $model())->getRouteKeyName(); $this->record = $model::where($routeKeyName, $record)->firstOrFail(); + + $this->callHook('afterFill'); } public function save() diff --git a/src/Resources/Tables/Columns/Column.php b/src/Resources/Tables/Columns/Column.php new file mode 100644 index 0000000000..dba59832b3 --- /dev/null +++ b/src/Resources/Tables/Columns/Column.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 @@ +