Forms\Components\FileUpload::make('country_image')
->image()
->required()
->directory("CountryImage")
->columnSpanFull()
Forms\Components\FileUpload::make('country_flag')
->image()
->required()
->directory("CountryFlag")
->columnSpanFull()
]);
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
return null;
$class = (string) $namespace
->append('\\', $file->getRelativePathname())
->replace('*', $variableNamespace ?? '')
->replace([DIRECTORY_SEPARATOR, '.php'], ['\\', '']);
if (! class_exists($class)) {
continue;
}
if ((new ReflectionClass($class))->isAbstract()) {
continue;
{
$this->resourceDirectories[] = $in;
$this->resourceNamespaces[] = $for;
$this->discoverComponents(
Resource::class,
$this->resources,
directory: $in,
namespace: $for,
);
->brandName('UNIABROAD Admin Panel')
->favicon(asset('favicon.ico'))
->colors([
'primary' => Color::hex('#9bc329'),
])
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
abstract public function panel(Panel $panel): Panel;
public function register(): void
{
Filament::registerPanel(
fn (): Panel => $this->panel(Panel::make()),
);
}
}
* @param mixed ...$args
* @return mixed
*/
function value($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $value;
}
}
public static function registerPanel(Panel | Closure $panel): void
{
static::getFacadeApplication()->resolving(
static::getFacadeAccessor(),
fn (FilamentManager $filamentManager) => $filamentManager->registerPanel(value($panel)),
);
}
}
* @return void
*/
protected function fireCallbackArray($object, array $callbacks)
{
foreach ($callbacks as $callback) {
$callback($object, $this);
}
}
/**
* Get the container's bindings.
protected function fireResolvingCallbacks($abstract, $object)
{
$this->fireCallbackArray($object, $this->globalResolvingCallbacks);
$this->fireCallbackArray(
$object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks)
);
$this->fireAfterResolvingCallbacks($abstract, $object);
}
if ($this->isShared($abstract) && ! $needsContextualBuild) {
$this->instances[$abstract] = $object;
}
if ($raiseEvents) {
$this->fireResolvingCallbacks($abstract, $object);
}
// Before returning, we will also set the resolved flag to "true" and pop off
// the parameter overrides for this build. After those two things are done
// we will be ready to return back the fully constructed class instance.
*/
protected function resolve($abstract, $parameters = [], $raiseEvents = true)
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::resolve($abstract, $parameters, $raiseEvents);
}
/**
* Load the deferred provider if the given type is a deferred service and the instance has not been loaded.
*
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
public function make($abstract, array $parameters = [])
{
return $this->resolve($abstract, $parameters);
}
/**
* {@inheritdoc}
*
*/
public function make($abstract, array $parameters = [])
{
$this->loadDeferredProviderIfNeeded($abstract = $this->getAlias($abstract));
return parent::make($abstract, $parameters);
}
/**
* Resolve the given type from the container.
*
* @param string $key
* @return mixed
*/
public function offsetGet($key): mixed
{
return $this->make($key);
}
/**
* Set the value at a given offset.
*
return static::$resolvedInstance[$name];
}
if (static::$app) {
if (static::$cached) {
return static::$resolvedInstance[$name] = static::$app[$name];
}
return static::$app[$name];
}
}
*
* @return mixed
*/
public static function getFacadeRoot()
{
return static::resolveFacadeInstance(static::getFacadeAccessor());
}
/**
* Get the registered name of the component.
*
*
* @throws \RuntimeException
*/
public static function __callStatic($method, $args)
{
$instance = static::getFacadeRoot();
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
use Filament\Http\Controllers\RedirectToTenantController;
use Illuminate\Support\Facades\Route;
Route::name('filament.')
->group(function () {
foreach (Filament::getPanels() as $panel) {
/** @var \Filament\Panel $panel */
$panelId = $panel->getId();
$hasTenancy = $panel->hasTenancy();
$tenantRoutePrefix = $panel->getTenantRoutePrefix();
$tenantSlugAttribute = $panel->getTenantSlugAttribute();
* @return void
*/
protected function loadRoutes($routes)
{
if ($routes instanceof Closure) {
$routes($this);
} else {
(new RouteFileRegistrar($this))->register($routes);
}
}
$this->updateGroupStack($attributes);
// Once we have updated the group stack, we'll load the provided routes and
// merge in the group's attributes when the routes are created. After we
// have created the routes, we will pop the attributes off the stack.
$this->loadRoutes($groupRoutes);
array_pop($this->groupStack);
}
return $this;
* @param \Closure|array|string $callback
* @return $this
*/
public function group($callback)
{
$this->router->group($this->attributes, $callback);
return $this;
}
/**
});
}
});
}
}
});
* @return void
*/
protected function loadRoutesFrom($path)
{
if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) {
require $path;
}
}
/**
* Register a view file namespace.
], "{$this->package->shortName()}-provider");
}
foreach ($this->package->routeFileNames as $routeFileName) {
$this->loadRoutesFrom("{$this->package->basePath('/../routes/')}{$routeFileName}.php");
}
foreach ($this->package->sharedViewData as $name => $value) {
View::share($name, $value);
}
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed ...$args
* @return mixed
*/
public static function unwrapIfClosure($value, ...$args)
{
return $value instanceof Closure ? $value(...$args) : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
*
$this->buildStack[] = $className;
$pushedToBuildStack = true;
}
$result = BoundMethod::call($this, $callback, $parameters, $defaultMethod);
if ($pushedToBuildStack) {
array_pop($this->buildStack);
}
protected function bootProvider(ServiceProvider $provider)
{
$provider->callBootingCallbacks();
if (method_exists($provider, 'boot')) {
$this->call([$provider, 'boot']);
}
$provider->callBootedCallbacks();
}
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
}
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$app->boot();
}
}
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
ParseError
|
---|
ParseError: syntax error, unexpected namespaced name "Forms\Components\FileUpload", expecting "]" at /var/www/html/app/Filament/Resources/CountryResource.php:103 at Composer\Autoload\includeFile() (/var/www/html/vendor/composer/ClassLoader.php:428) at Composer\Autoload\ClassLoader->loadClass() at class_exists() (/var/www/html/vendor/filament/filament/src/Panel/Concerns/HasComponents.php:404) at Filament\Panel->discoverComponents() (/var/www/html/vendor/filament/filament/src/Panel/Concerns/HasComponents.php:268) at Filament\Panel->discoverResources() (/var/www/html/app/Providers/Filament/AdminPanelProvider.php:36) at App\Providers\Filament\AdminPanelProvider->panel() (/var/www/html/vendor/filament/filament/src/PanelProvider.php:15) at Filament\PanelProvider->Filament\{closure}() (/var/www/html/vendor/laravel/framework/src/Illuminate/Collections/helpers.php:224) at value() (/var/www/html/vendor/filament/filament/src/Facades/Filament.php:132) at Filament\Facades\Filament::Filament\Facades\{closure}() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:1302) at Illuminate\Container\Container->fireCallbackArray() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:1249) at Illuminate\Container\Container->fireResolvingCallbacks() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:813) at Illuminate\Container\Container->resolve() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:957) at Illuminate\Foundation\Application->resolve() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:731) at Illuminate\Container\Container->make() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:942) at Illuminate\Foundation\Application->make() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:1454) at Illuminate\Container\Container->offsetGet() (/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237) at Illuminate\Support\Facades\Facade::resolveFacadeInstance() (/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208) at Illuminate\Support\Facades\Facade::getFacadeRoot() (/var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:349) at Illuminate\Support\Facades\Facade::__callStatic() (/var/www/html/vendor/filament/filament/routes/web.php:12) at Illuminate\Support\ServiceProvider->{closure}() (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:509) at Illuminate\Routing\Router->loadRoutes() (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:465) at Illuminate\Routing\Router->group() (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php:194) at Illuminate\Routing\RouteRegistrar->group() (/var/www/html/vendor/filament/filament/routes/web.php:135) at require('/var/www/html/vendor/filament/filament/routes/web.php') (/var/www/html/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:152) at Illuminate\Support\ServiceProvider->loadRoutesFrom() (/var/www/html/vendor/spatie/laravel-package-tools/src/PackageServiceProvider.php:152) at Spatie\LaravelPackageTools\PackageServiceProvider->boot() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41) at Illuminate\Container\Util::unwrapIfClosure() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call() (/var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:662) at Illuminate\Container\Container->call() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1030) at Illuminate\Foundation\Application->bootProvider() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1011) at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() at array_walk() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1012) at Illuminate\Foundation\Application->boot() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17) at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:263) at Illuminate\Foundation\Application->bootstrapWith() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:186) at Illuminate\Foundation\Http\Kernel->bootstrap() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:170) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144) at Illuminate\Foundation\Http\Kernel->handle() (/var/www/html/public/index.php:52) |