Symfony Exception

ParseError

HTTP 500 Internal Server Error

syntax error, unexpected namespaced name "Forms\Components\FileUpload", expecting "]"

Exception

ParseError

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

Stack Trace

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)