Can someone help me with this error? Got it during Laravel 4.2 Migrations
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Uncaught TypeError: Argument 1 passed to Illuminate\Exception\WhoopsDisplayer::display() must be an instance of Exception, instance of ParseError given, called in C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php on line 9462 and defined in C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php:9352\nStack trace:\n#0 C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php(9462): Illuminate\Exception\WhoopsDisplayer->display(Object(ParseError))\n#1 C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php(9414): Illuminate\Exception\Handler->displayException(Object(ParseError))\n#2 C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php(9418): Illuminate\Exception\Handler->handleException(Object(ParseError))\n#3 [internal function]: Illuminate\Exception\Handler->handleUncaughtException(Object(ParseError))\n#4 {main}\n thrown","file":"C:\Users\adejaremola\Desktop\UniServerZ\www\GoingFurther\bootstrap\compiled.php","line":9352}}
It looks like you're trying to call the laravel's migration from the browser. It won't work here unfortunately.
You should run it from the CLI using command in the project root:
$ php artisan migrate
Related
I am getting the following code error after trying to upgrade to laravel 6 from 5.8, has anyone experienced this before?
Fatal error: Uncaught TypeError: Argument 2 passed to Illuminate\Routing\UrlGenerator::__construct() must be an instance of Illuminate\Http\Request, null given, called in C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php on line 68 and defined in C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Routing\UrlGenerator.php:120
Stack trace:
#0 C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Routing\RoutingServiceProvider.php(68): Illuminate\Routing\UrlGenerator->__construct(Object(Illuminate\Routing\RouteCollection), NULL, NULL)
#1 C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Container\Container.php(799): Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Container\Container.php(681): Illuminate\Container\Container->build(Object(Closure))
#3 C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\ in C:\xampp\htdocs\rebuild\vendor\laravel\framework\src\Illuminate\Routing\UrlGenerator.php on line 120
Similar issue is already listing on on Laravel repository and on Laracasts
It seems the problem is because of url() and asset() Helper functions used within in configuration files.
To resolve this error use config() or base_path or define absolute or relative paths in your config files instead of url() and assset() function for e.g
'cdn' => url('vendor/js/tinymce/tinymce.min.js'),
Changing it to
'cdn' => Config('app.url').'/vendor/js/tinymce/tinymce.min.js',
Change asset('home') to base_path('public/home'),
NOTE: You shouldn't use laravel dependencies inside config because the
config is loaded early in the request life cycle and things like
global helpers may not be available.
If you are using some dependencies in config file define them in .env files
I am using laravel 5.5 and I get an error when I create my controller.
$ php artisan make:controller MyDatatablesController
I want to create new controller but I get this error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)
Your command is perfect their is some error in your project check your recent changes in your project
You're having an error on your own code. Probably it's a code not always executed. Try executing the command in verbose mode to have more information about the error
php artisan make:controller MyDatatablesController -vvv
FatalErrorException in Router.php line 737:
Class 'Illuminate\Support\Collection' not found
Getting this error while uploading on hosting server. I have updated my composer but am still getting this error.
Just change php version to a matching version.
I ran config:cache in my Laravel 5.2 application and this error started showing up.
Fatal error: Uncaught ReflectionException: Class log does not exist in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php:738 Stack trace: #0 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(738): ReflectionClass->__construct('log') #1 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(633): Illuminate\Container\Container->build('log', Array) #2 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(697): Illuminate\Container\Container->make('log', Array) #3 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(853): Illuminate\Foundation\Application->make('log') #4 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(808): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #5 F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php(7 in F:\xampp\htdocs\news5.2.23\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 738
I looked for many solutions. Nothing worked for me.
My .env file does not have any spaces
I deleted extra packages from my composer.json and ran composer update.
I ran php artisan clear compiled many times.
I looked for errors in my files but could not find any.
I also enabled the mysql extension since I found it somewhere. Then I did a fresh checkout of Laravel 5.2 and now the error is like this.
So, it's not a problem of any config file of mine. Its something else. Any of you have any idea?
Ok , so I solved it. Looks liek I had multiple issues.
In my fresh check out of laravel 5.2, where I was finding error about not having vendor/autoload.php file, I ran in the root directory in command window,
'composer update --no-scripts' , then 'composer update'. That solved the issue.
I also had to enable my mysql extension by editing php.ini file.
Finally, in my existing project, I actually found a problem in config/app.php. I missed a ',' somewhere. And people, laravel is a disgusting debugger. I miss my cakephp more.
It's a laravel 5 issue. Better to use laravel 4 still
Run this command:
php artisan dump-autoload
then composer update
I've just finished updating an app from Laravel 5.1 to 5.2. Everything is working fine on my local Homestead install. When I deploy to my forge server, the process is failing with the following error:
PHP Fatal error: A precedence rule was defined for
Illuminate\Foundation\Auth\AuthenticatesUsers::getGuard but this
method does not exist in
/home/forge/myapp/vendor/laravel/framework/src/Illuminate/Foundation/Auth/AuthenticatesAndRegistersUsers.php
on line 11
What could be causing this? I've tried running composer dump-autoload after the update, but still no luck.
Any advice appreciated.
I fixed this by deleting /bootstrap/cache/compiled.php. The files the error refers to were fine.
The AuthenticatesAndRegistersUsers has a precedence statement to use getGuard from AuthenticatesUsers instead of from RegistersUsers.
The AuthenticatesUsers trait has a getGuard method defined in it.
Double check to make sure your version of that trait has the getGuard method and or double check those traits against the ones in the laravel repository.