mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Merge branch '2.x' of github.com:maherelgamil/filament into 2.x
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Filament\Commands\Concerns;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
trait CanValidateInput
|
||||
@@ -11,7 +12,7 @@ trait CanValidateInput
|
||||
return $this->validateInput(fn () => $this->ask($question), $field, ['required']);
|
||||
}
|
||||
|
||||
protected function validateInput(callable $callback, string $field, array $rules): string
|
||||
protected function validateInput(Closure $callback, string $field, array $rules): string
|
||||
{
|
||||
$input = $callback();
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Filament\Facades;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Authenticatable;
|
||||
use Illuminate\Contracts\Auth\StatefulGuard;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
@@ -30,7 +31,7 @@ use Illuminate\Support\Facades\Facade;
|
||||
* @method static void registerStyles(array $styles)
|
||||
* @method static void registerTheme(string $url)
|
||||
* @method static void registerWidgets(array $widgets)
|
||||
* @method static void serving(callable $widgets)
|
||||
* @method static void serving(Closure $callback)
|
||||
*
|
||||
* @see \Filament\FilamentManager
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Filament;
|
||||
|
||||
use Closure;
|
||||
use Filament\Events\ServingFilament;
|
||||
use Filament\Models\Contracts\HasAvatar;
|
||||
use Filament\Models\Contracts\HasName;
|
||||
@@ -95,7 +96,7 @@ class FilamentManager
|
||||
$this->widgets = array_merge($this->widgets, $widgets);
|
||||
}
|
||||
|
||||
public function serving(callable $callback): void
|
||||
public function serving(Closure $callback): void
|
||||
{
|
||||
Event::listen(ServingFilament::class, $callback);
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
namespace Filament\Pages\Actions\Concerns;
|
||||
|
||||
use Closure;
|
||||
|
||||
trait CanOpenUrl
|
||||
{
|
||||
protected bool $shouldOpenUrlInNewTab = false;
|
||||
|
||||
protected $url = null;
|
||||
protected string | Closure | null $url = null;
|
||||
|
||||
public function openUrlInNewTab(bool $condition = true): static
|
||||
{
|
||||
@@ -15,7 +17,7 @@ trait CanOpenUrl
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function url(string | callable | null $url, bool $shouldOpenInNewTab = false): static
|
||||
public function url(string | Closure | null $url, bool $shouldOpenInNewTab = false): static
|
||||
{
|
||||
$this->shouldOpenUrlInNewTab = $shouldOpenInNewTab;
|
||||
$this->url = $url;
|
||||
|
||||
Reference in New Issue
Block a user