* @throws \UnexpectedValueException */ protected static function makeInvokable($action) { if (! method_exists($action, '__invoke')) { throw new UnexpectedValueException("Invalid route action: [{$action}]."); } return $action.'@__invoke'; } elseif (! isset($action['uses'])) { $action['uses'] = static::findCallable($action); } if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! Str::contains($action['uses'], '@')) { $action['uses'] = static::makeInvokable($action['uses']); } return $action; } * * @throws \UnexpectedValueException */ protected function parseAction($action) { return RouteAction::parse($this->uri, $action); } /** * Run the route action and return the response. * */ public function __construct($methods, $uri, $action) { $this->uri = $uri; $this->methods = (array) $methods; $this->action = Arr::except($this->parseAction($action), ['prefix']); if (in_array('GET', $this->methods) && ! in_array('HEAD', $this->methods)) { $this->methods[] = 'HEAD'; } * @param mixed $action * @return \Illuminate\Routing\Route */ public function newRoute($methods, $uri, $action) { return (new Route($methods, $uri, $action)) ->setRouter($this) ->setContainer($this->container); } /** if ($this->actionReferencesController($action)) { $action = $this->convertToControllerAction($action); } $route = $this->newRoute( $methods, $this->prefix($uri), $action ); // If we have groups that need to be merged, we will merge them now after this // route has already been created and is ready to go. After we're done with // the merge we will be ready to return the route back out to the caller. * @param array|string|callable|null $action * @return \Illuminate\Routing\Route */ public function addRoute($methods, $uri, $action) { return $this->routes->add($this->createRoute($methods, $uri, $action)); } /** * Create a new route instance. * * @param array|string|callable|null $action * @return \Illuminate\Routing\Route */ public function get($uri, $action = null) { return $this->addRoute(['GET', 'HEAD'], $uri, $action); } /** * Register a new POST route with the router. * if (! $instance) { throw new RuntimeException('A facade root has not been set.'); } return $instance->$method(...$args); }} Route::post('/home/setSessionSelectedDevice',[HomeController::class,'setSelectedDeviceSession'])->name('home.setSessionSelectedDevice');
Route::post('/home/sethook',[HomeController::class,'setHook'])->name('setHook');
Route::post('/home',[HomeController::class,'store'])->name('addDevice');
Route::delete('/home',[HomeController::class,'destroy'])->name('deleteDevice');
Route::get('/scan/{number:body}', ScanController::class)->name('scan');
Route::get('/autoreply',[AutoreplyController::class,'index'])->name('autoreply');
Route::post('/autoreply',[AutoreplyController::class,'store'])->name('autoreply');
Route::delete('/autoreply',[AutoreplyController::class,'destroy'])->name('autoreply.delete');
Route::post('auto-reply/update/{autoreply:id}',[AutoreplyController::class,'update'])->name('autoreply.update');
* @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($routes); array_pop($this->groupStack); } /** * @param \Closure|string $callback * @return void */ public function group($callback) { $this->router->group($this->attributes, $callback); } /** * Register a new route with the given verbs. *
Route::post('/logout', LogoutController::class)->name('logout');
});
Route::middleware('guest')->group(function(){
Route::get('/login',[LoginController::class,'index'])->name('login');
Route::get('/register',[RegisterController::class,'index'])->name('register');
*/ public function register($routes) { $router = $this->router; require $routes; }} protected function loadRoutes($routes) { if ($routes instanceof Closure) { $routes($this); } else { (new RouteFileRegistrar($this))->register($routes); } } /** * Get the prefix from the last group on the stack. $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($routes); array_pop($this->groupStack); } /** * @param \Closure|string $callback * @return void */ public function group($callback) { $this->router->group($this->attributes, $callback); } /** * Register a new route with the given verbs. * ->namespace($this->namespace) ->group(base_path('routes/api.php')); Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); }); } /** * Configure the rate limiters for the application. 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 $value * @return mixed */ public static function unwrapIfClosure($value) { return $value instanceof Closure ? $value() : $value; } /** * Get the class name of the given parameter's type, if possible. * * @return mixed */ protected static function callBoundMethod($container, $callback, $default) { if (! is_array($callback)) { return Util::unwrapIfClosure($default); } // Here we need to turn the array callable into a Class@method string we can use to // examine the container and see if there are any method bindings for this given // method. If there are, we can call this method binding callback immediately. 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. * * * @throws \InvalidArgumentException */ public function call($callback, array $parameters = [], $defaultMethod = null) { return BoundMethod::call($this, $callback, $parameters, $defaultMethod); } /** * Get a closure to resolve the given type from the container. * * @return void */ protected function loadRoutes() { if (! is_null($this->loadRoutesUsing)) { $this->app->call($this->loadRoutesUsing); } elseif (method_exists($this, 'map')) { $this->app->call([$this, 'map']); } } $this->setRootControllerNamespace(); if ($this->routesAreCached()) { $this->loadCachedRoutes(); } else { $this->loadRoutes(); $this->app->booted(function () { $this->app['router']->getRoutes()->refreshNameLookups(); $this->app['router']->getRoutes()->refreshActionLookups(); }); 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 $value * @return mixed */ public static function unwrapIfClosure($value) { return $value instanceof Closure ? $value() : $value; } /** * Get the class name of the given parameter's type, if possible. * * @return mixed */ protected static function callBoundMethod($container, $callback, $default) { if (! is_array($callback)) { return Util::unwrapIfClosure($default); } // Here we need to turn the array callable into a Class@method string we can use to // examine the container and see if there are any method bindings for this given // method. If there are, we can call this method binding callback immediately. 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. * * * @throws \InvalidArgumentException */ public function call($callback, array $parameters = [], $defaultMethod = null) { return BoundMethod::call($this, $callback, $parameters, $defaultMethod); } /** * Get a closure to resolve the given type from the container. * public function callBootedCallbacks() { $index = 0; while ($index < count($this->bootedCallbacks)) { $this->app->call($this->bootedCallbacks[$index]); $index++; } } if (method_exists($provider, 'boot')) { $this->call([$provider, 'boot']); } $provider->callBootedCallbacks(); } /** * Register a new boot listener. * // 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()); public function handle($request) { 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);|
UnexpectedValueException
|
|---|
UnexpectedValueException:
Invalid route action: [App\Http\Controllers\ScanController].
at /home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/RouteAction.php:92
at Illuminate\Routing\RouteAction::makeInvokable('App\\Http\\Controllers\\ScanController')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/RouteAction.php:47)
at Illuminate\Routing\RouteAction::parse('scan/{number:body}', array('uses' => 'App\\Http\\Controllers\\ScanController', 'controller' => 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Route.php:191)
at Illuminate\Routing\Route->parseAction(array('uses' => 'App\\Http\\Controllers\\ScanController', 'controller' => 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Route.php:172)
at Illuminate\Routing\Route->__construct(array('GET', 'HEAD'), 'scan/{number:body}', array('uses' => 'App\\Http\\Controllers\\ScanController', 'controller' => 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:583)
at Illuminate\Routing\Router->newRoute(array('GET', 'HEAD'), 'scan/{number:body}', array('uses' => 'App\\Http\\Controllers\\ScanController', 'controller' => 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:476)
at Illuminate\Routing\Router->createRoute(array('GET', 'HEAD'), '/scan/{number:body}', array('uses' => 'App\\Http\\Controllers\\ScanController', 'controller' => 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:455)
at Illuminate\Routing\Router->addRoute(array('GET', 'HEAD'), '/scan/{number:body}', 'App\\Http\\Controllers\\ScanController')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:147)
at Illuminate\Routing\Router->get('/scan/{number:body}', 'App\\Http\\Controllers\\ScanController')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261)
at Illuminate\Support\Facades\Facade::__callStatic('get', array('/scan/{number:body}', 'App\\Http\\Controllers\\ScanController'))
(/home/socialsho2/ws.socialshop.cl/routes/web.php:47)
at Illuminate\Routing\RouteFileRegistrar->{closure}(object(Router))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:423)
at Illuminate\Routing\Router->loadRoutes(object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:382)
at Illuminate\Routing\Router->group(array('middleware' => array('auth')), object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php:163)
at Illuminate\Routing\RouteRegistrar->group(object(Closure))
(/home/socialsho2/ws.socialshop.cl/routes/web.php:114)
at require('/home/socialsho2/ws.socialshop.cl/routes/web.php')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php:35)
at Illuminate\Routing\RouteFileRegistrar->register('/home/socialsho2/ws.socialshop.cl/routes/web.php')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:425)
at Illuminate\Routing\Router->loadRoutes('/home/socialsho2/ws.socialshop.cl/routes/web.php')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/Router.php:382)
at Illuminate\Routing\Router->group(array('middleware' => array('web'), 'namespace' => null), '/home/socialsho2/ws.socialshop.cl/routes/web.php')
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php:163)
at Illuminate\Routing\RouteRegistrar->group('/home/socialsho2/ws.socialshop.cl/routes/web.php')
(/home/socialsho2/ws.socialshop.cl/app/Providers/RouteServiceProvider.php:47)
at App\Providers\RouteServiceProvider->App\Providers\{closure}()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36)
at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/Util.php:40)
at Illuminate\Container\Util::unwrapIfClosure(object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:81)
at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), object(Closure), object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37)
at Illuminate\Container\BoundMethod::call(object(Application), object(Closure), array(), null)
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/Container.php:653)
at Illuminate\Container\Container->call(object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php:120)
at Illuminate\Foundation\Support\Providers\RouteServiceProvider->loadRoutes()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php:45)
at Illuminate\Foundation\Support\Providers\RouteServiceProvider->Illuminate\Foundation\Support\Providers\{closure}()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36)
at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/Util.php:40)
at Illuminate\Container\Util::unwrapIfClosure(object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:81)
at Illuminate\Container\BoundMethod::callBoundMethod(object(Application), object(Closure), object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37)
at Illuminate\Container\BoundMethod::call(object(Application), object(Closure), array(), null)
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Container/Container.php:653)
at Illuminate\Container\Container->call(object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:119)
at Illuminate\Support\ServiceProvider->callBootedCallbacks()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:927)
at Illuminate\Foundation\Application->bootProvider(object(RouteServiceProvider))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:905)
at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(object(RouteServiceProvider), 24)
at array_walk(array(object(EventServiceProvider), object(LogServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(ParallelTestingServiceProvider), object(FoundationServiceProvider), object(NotificationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ViewServiceProvider), object(CorsServiceProvider), object(ImageServiceProvider), object(SanctumServiceProvider), object(ExcelServiceProvider), object(ServiceProvider), object(LaravelFilemanagerServiceProvider), object(AppServiceProvider), object(AuthServiceProvider), object(EventServiceProvider), object(RouteServiceProvider), object(CustomServiceProvider), object(CacheServiceProvider)), object(Closure))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:906)
at Illuminate\Foundation\Application->boot()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17)
at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(object(Application))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:237)
at Illuminate\Foundation\Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders'))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:153)
at Illuminate\Foundation\Http\Kernel->bootstrap()
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:137)
at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
(/home/socialsho2/ws.socialshop.cl/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111)
at Illuminate\Foundation\Http\Kernel->handle(object(Request))
(/home/socialsho2/ws.socialshop.cl/public/index.php:51)
|