mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge branch 'develop' of github.com:laravel-filament/filament into register-with-livewire
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'dateTimePicker' => [
|
||||
|
||||
'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' => 'كلمة مفتاحية جديدة',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
'goToPage' => 'انتقل إلى صفحة :page',
|
||||
'next' => 'التالي',
|
||||
'previous' => 'السابق',
|
||||
],
|
||||
|
||||
'label' => 'التنقل بين الصفحات',
|
||||
|
||||
'overview' => [
|
||||
'عرض',
|
||||
'إلي',
|
||||
'من',
|
||||
'النتائج',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'delete' => [
|
||||
|
||||
'button' => [
|
||||
'label' => 'حذف المحدد',
|
||||
],
|
||||
|
||||
'modal' => [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'cancel' => [
|
||||
'label' => 'إلغاء',
|
||||
],
|
||||
|
||||
'delete' => [
|
||||
'label' => 'حذف المحدد',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'description' => 'هل أنت متأكد أنك تريد حذف السجلات المختارة؟ لا يمكن التراجع عن هذا الإجراء.',
|
||||
|
||||
'heading' => 'حذف السجلات المحددة؟',
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'filter' => [
|
||||
'placeholder' => 'تصفية',
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'noRecords' => 'لا توجد سجلات',
|
||||
],
|
||||
|
||||
'pagination' => [
|
||||
|
||||
'fields' => [
|
||||
|
||||
'recordsPerPage' => [
|
||||
'label' => 'لكل صفحة',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'search' => [
|
||||
'placeholder' => 'بحث',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'submit' => [
|
||||
'label' => 'تسجيل الدخول',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'form' => [
|
||||
|
||||
'email' => [
|
||||
'label' => 'البريد الإلكتروني',
|
||||
],
|
||||
|
||||
'password' => [
|
||||
'hint' => 'نسيت كلمة المرور؟',
|
||||
'label' => 'كلمة المرور',
|
||||
],
|
||||
|
||||
'remember' => [
|
||||
'label' => 'تذكرني',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'failed' => 'بيانات الاعتماد هذه غير متطابقة مع البيانات المسجلة لدينا.',
|
||||
'throttled' => 'عدد كبير جدا من محاولات الدخول. يرجى المحاولة مرة أخرى بعد :seconds ثانية.',
|
||||
],
|
||||
|
||||
'title' => 'تسجيل الدخول إلى حسابك',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'button' => [
|
||||
'label' => 'خروج',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'submit' => [
|
||||
'label' => 'إرسال رابط إعادة تعيين كلمة المرور',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'form' => [
|
||||
|
||||
'email' => [
|
||||
'hint' => 'العودة إلى تسجيل الدخول',
|
||||
'label' => 'البريد الإلكتروني',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
|
||||
'throttled' => 'عدد كبير جدا من محاولات الدخول. يرجى المحاولة مرة أخرى بعد :seconds ثانية.',
|
||||
|
||||
'passwords' => [
|
||||
'sent' => 'تم إرسال تفاصيل استعادة كلمة المرور الخاصة بك إلى بريدك الإلكتروني!',
|
||||
'throttled' => 'الرجاء الانتظار قبل إعادة المحاولة.',
|
||||
'user' => 'لم يتم العثور على أيّ حسابٍ بهذا العنوان الإلكتروني.',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'title' => 'إعادة تعيين كلمة المرور',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'submit' => [
|
||||
'label' => 'إعادة تعيين كلمة المرور',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'form' => [
|
||||
|
||||
'email' => [
|
||||
'label' => 'البريد الإلكتروني',
|
||||
],
|
||||
|
||||
'password' => [
|
||||
'label' => 'كلمة المرور',
|
||||
],
|
||||
|
||||
'passwordConfirmation' => [
|
||||
'label' => 'تأكيد كلمة المرور',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
|
||||
'passwords' => [
|
||||
'throttled' => 'الرجاء الانتظار قبل إعادة المحاولة.',
|
||||
'token' => 'رمز استعادة كلمة المرور الذي أدخلته غير صحيح.',
|
||||
'user' => 'لم يتم العثور على أيّ حسابٍ بهذا العنوان الإلكتروني.',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'title' => 'إعادة تعيين كلمة المرور',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'title' => 'لوحة التحكم',
|
||||
|
||||
'widgets' => [
|
||||
|
||||
'account' => [
|
||||
|
||||
'heading' => 'أهلا بك, :name',
|
||||
|
||||
'links' => [
|
||||
|
||||
'account' => [
|
||||
'label' => 'إدارة حسابك',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'filament' => [
|
||||
|
||||
'links' => [
|
||||
|
||||
'documentation' => [
|
||||
'label' => 'تصفح الوثائق',
|
||||
],
|
||||
|
||||
'repository' => [
|
||||
'label' => 'Visit the repository',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'save' => [
|
||||
'label' => 'حفظ',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'saved' => 'تم الحفظ!',
|
||||
],
|
||||
|
||||
'title' => 'الحساب',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'dropdown' => [
|
||||
|
||||
'account' => [
|
||||
'label' => 'تعديل الحساب',
|
||||
],
|
||||
|
||||
'users' => [
|
||||
'label' => 'إدارة المستخدمين',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'create' => [
|
||||
'label' => 'إنشاء',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'delete' => [
|
||||
'label' => 'حذف',
|
||||
],
|
||||
|
||||
'save' => [
|
||||
'label' => 'حفظ',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'modals' => [
|
||||
|
||||
'delete' => [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'cancel' => [
|
||||
'label' => 'إلغاء',
|
||||
],
|
||||
|
||||
'confirm' => [
|
||||
'label' => 'تأكيد',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'description' => 'هل أنت متأكد أنك تريد حذف هذا السجل؟ لا يمكن التراجع عن هذا الإجراء.',
|
||||
|
||||
'heading' => 'حذف هذا السجل؟',
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'messages' => [
|
||||
'saved' => 'تم الحفظ!',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'create' => [
|
||||
'label' => 'إنشاء',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
'table' => [
|
||||
|
||||
'recordActions' => [
|
||||
|
||||
'edit' => [
|
||||
'label' => 'تعديل',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'buttons' => [
|
||||
|
||||
'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' => 'تم الحفظ!',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'form' => [
|
||||
|
||||
'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' => 'المشرفون',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Commands\Aliases;
|
||||
|
||||
use Filament\Commands;
|
||||
|
||||
class MakeColumnCommand extends Commands\MakeColumnCommand
|
||||
{
|
||||
protected $signature = 'filament:column {name} {--R|resource}';
|
||||
|
||||
protected $hidden = true;
|
||||
}
|
||||
@@ -5,4 +5,6 @@ namespace Filament\Commands\Aliases;
|
||||
class MakeFilterCommand extends \Filament\Commands\MakeFilterCommand
|
||||
{
|
||||
protected $signature = 'filament:filter {name} {--R|resource}';
|
||||
|
||||
protected $hidden = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Commands\Aliases;
|
||||
|
||||
use Filament\Commands;
|
||||
|
||||
class MakeFormComponentCommand extends Commands\MakeFormComponentCommand
|
||||
{
|
||||
protected $signature = 'filament:form-component {name} {--R|resource}';
|
||||
|
||||
protected $hidden = true;
|
||||
}
|
||||
@@ -5,4 +5,6 @@ namespace Filament\Commands\Aliases;
|
||||
class MakeThemeCommand extends \Filament\Commands\MakeThemeCommand
|
||||
{
|
||||
protected $signature = 'filament:theme {name}';
|
||||
|
||||
protected $hidden = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MakeColumnCommand extends Command
|
||||
{
|
||||
use Concerns\CanManipulateFiles;
|
||||
|
||||
protected $description = 'Creates a Filament column class and cell view.';
|
||||
|
||||
protected $signature = 'make:filament-column {name} {--R|resource}';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$column = (string) Str::of($this->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}!");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class MakeFormComponentCommand extends Command
|
||||
{
|
||||
use Concerns\CanManipulateFiles;
|
||||
|
||||
protected $description = 'Creates a Filament form component class and view.';
|
||||
|
||||
protected $signature = 'make:filament-form-component {name} {--R|resource}';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$component = (string) Str::of($this->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}!");
|
||||
}
|
||||
}
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Resources\Forms\Components;
|
||||
|
||||
class Component extends \Filament\Forms\Components\Component
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Resources\Forms\Components;
|
||||
|
||||
class Field extends \Filament\Forms\Components\Field
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -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()
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Resources\Tables\Columns;
|
||||
|
||||
class Column extends \Filament\Tables\Columns\Column
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div>
|
||||
{{ $column->getValue($record) }}
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class {{ class }} extends Column
|
||||
{
|
||||
public $view = '{{ view }}';
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Filament\Forms\Components\Component;
|
||||
|
||||
class {{ class }} extends Component
|
||||
{
|
||||
public $view = '{{ view }}';
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<div
|
||||
id="{{ $formComponent->getId() }}"
|
||||
>
|
||||
{{-- Form component content --}}
|
||||
</div>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Filament\Resources\Tables\Columns\Column;
|
||||
|
||||
class {{ class }} extends Column
|
||||
{
|
||||
public $view = '{{ view }}';
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Filament\Forms\Components\Field;
|
||||
use Filament\Resources\Forms\Components\Concerns;
|
||||
use Filament\Resources\Forms\Components\Field;
|
||||
|
||||
class {{ class }} extends Field
|
||||
{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace {{ namespace }};
|
||||
|
||||
use Filament\Resources\Forms\Components\Component;
|
||||
|
||||
class {{ class }} extends Component
|
||||
{
|
||||
public $view = '{{ view }}';
|
||||
}
|
||||
Reference in New Issue
Block a user