techouse/intl-date-time

Using a psr-4 different from App

Closed this issue · 2 comments

I'm using another psr-4 for my Laravel App with Nova and intl-date-time is not working properly. See IntlDateTimeController.php code:

<?php

namespace Techouse\IntlDateTime;

**use App\Http\Controllers\Controller;**
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Support\Facades\File;
use Laravel\Nova\Http\Requests\NovaRequest;

class IntlDateTimeController extends Controller
{


As App\Http\Controllers\Controller is used I've got the following error:

[2019-11-06 23:00:35] local.ERROR: Class 'App\Http\Controllers\Controller' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 1): Class 'App\\Http\\Controllers\\Controller' not found at /home/newton/git/laravel/nova/galileo/vendor/techouse/intl-date-time/src/IntlDateTimeController.php:10)
[stacktrace]
#0 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(148): Symfony\\Component\\Debug\\Exception\\FatalErrorException->__construct()
#1 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(134): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->fatalExceptionFromError()
#2 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleShutdown()
#3 /home/newton/git/laravel/nova/galileo/vendor/composer/ClassLoader.php(444): ()
#4 /home/newton/git/laravel/nova/galileo/vendor/composer/ClassLoader.php(322): Composer\\Autoload\\includeFile()
#5 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): Composer\\Autoload\\ClassLoader->loadClass()
#6 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): spl_autoload_call()
#7 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Container/Container.php(788): ReflectionClass->__construct()
#8 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Container/Container.php(667): Illuminate\\Foundation\\Application->build()
#9 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Container/Container.php(615): Illuminate\\Foundation\\Application->resolve()
#10 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(767): Illuminate\\Foundation\\Application->make()
#11 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Route.php(233): Illuminate\\Foundation\\Application->make()
#12 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Route.php(833): Illuminate\\Routing\\Route->getController()
#13 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Route.php(794): Illuminate\\Routing\\Route->controllerMiddleware()
#14 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->gatherMiddleware()
#15 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Router.php(673): Illuminate\\Routing\\Router->gatherRouteMiddleware()
#16 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Router.php(657): Illuminate\\Routing\\Router->runRouteWithinStack()
#17 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\\Routing\\Router->runRoute()
#18 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Router.php(612): Illuminate\\Routing\\Router->dispatchToRoute()
#19 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\\Routing\\Router->dispatch()
#20 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Galileo\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:173-177}()
#21 /home/newton/git/laravel/nova/galileo/nova/src/Http/Middleware/ServeNova.php(26): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:28-36}()
#22 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle()
#23 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#24 /home/newton/git/laravel/nova/galileo/app/Http/Middleware/Gll/NovaLocaleMiddleware.php(20): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#25 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Galileo\\Http\\Middleware\\Gll\\NovaLocaleMiddleware->handle()
#26 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#27 /home/newton/git/laravel/nova/galileo/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#28 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Galileo\\Http\\Middleware\\TrustProxies->handle()
#29 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#30 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#31 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#32 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#33 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#34 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Galileo\\Http\\Middleware\\TrimStrings->handle()
#35 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#36 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#37 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#38 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#39 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#40 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Galileo\\Http\\Middleware\\CheckForMaintenanceMode->handle()
#41 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#42 /home/newton/git/laravel/nova/galileo/vendor/hyn/multi-tenant/src/Middleware/EagerIdentification.php(29): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#43 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Hyn\\Tenancy\\Middleware\\EagerIdentification->handle()
#44 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#45 /home/newton/git/laravel/nova/galileo/vendor/hyn/multi-tenant/src/Middleware/HostnameActions.php(75): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#46 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Hyn\\Tenancy\\Middleware\\HostnameActions->handle()
#47 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\\Routing\\Pipeline->Illuminate\\Pipeline\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:140-169}()
#48 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\\Routing\\Pipeline->Illuminate\\Routing\\{closure:/home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:47-59}()
#49 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\\Routing\\Pipeline->then()
#50 /home/newton/git/laravel/nova/galileo/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Galileo\\Http\\Kernel->sendRequestThroughRouter()
#51 /home/newton/git/laravel/nova/galileo/public/index.php(55): Galileo\\Http\\Kernel->handle()
#52 /home/newton/.composer/vendor/cpriego/valet-linux/server.php(204): ()
#53 /home/newton/.composer/vendor/cpriego/valet-linux/server.php(0): {main}()
#54 {main}
"} 


In v1.4.8 I have swapped App\Http\Controllers\Controller for Illuminate\Routing\Controller.

Can you please check if it works now?

Sorry, for not answering before, but it's working fine now. Tks!