I just update the compose and i found below error.
php artisan clear-compiled PHP Fatal error: Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive() in
/var/www/html/innomaid/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php
on line 213
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive()
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method
Illuminate\View\Compilers\BladeCompiler::directive() in
/var/www/html/innomaid/ve
ndor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on
line 213
Here is my composer code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.6.*",
"tymon/jwt-auth": "0.5.*",
"gloudemans/shoppingcart": "~1.3",
"intervention/image": "^2.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"zizaco/entrust": "dev-laravel-5"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
Please help me to solve this error
update "zizaco/entrust": "dev-laravel-5" to "zizaco/entrust": "1.4.1"
Solve my problem.
Related
when i run a command in laravel project :
php artisan optimize
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function get()
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
and
php artisan clear-compiled
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function get()
and
php artisan optimize --force
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function get()
and
{
composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing barryvdh/laravel-ide-helper (v2.1.4)
- Removing symfony/class-loader (v3.1.0)
Writing lock file
Generating autoload files
Illuminate\Foundation\ComposerScripts::postUpdate
php artisan optimize
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined function get()
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
}
and my composer.json is
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"laravelcollective/html": "5.2.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
so, what's wrong is it,and how can i fix it? thanks?
This error also comes when you did an error in creating a route.
Instead of Route::get(...) you may have put Route:get(...), So just check in your route or Controllers files
You're using get() method in a wrong way somewhere in your app (model or controller). Fix it and all commands will work again.
If you want more help, please post your recently added code which uses get() method.
I am using Laravel 5.1 and trying to install a new package via composer. I am using following command.
composer require "matriphe/imageupload:5.1.*"
I am getting following error.
./composer.json has been updated
> php artisan clear-compiled
Package "matriphe/imageupload" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> php artisan optimize
Generating optimized class loader
I also tried running
composer self-update
This is the message I received.
You are already using composer version f1aa655e6113e0efa979b8b09d7951a762eaa04c.
I have also tried updating composer dependencies for project via manually adding package name to composer.json and running.
composer update
and
partially updating via.
composer update "matriphe/imageupload:5.1.*"
Up until now I have installed other packages and all of them were installed except this one.
For me, it was simply a typo in the package name.
Update: I solved the issue in the most bizzare way possible.
I initially had following composer.json file when I ran the command
composer require "matriphe/imageupload:5.1.*"
and
composer require laravelcollective/html:~5.0
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"matriphe/imageupload": "5.1.*",
"laravelcollective/html": "~5.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
And got the error.
Package "matriphe/imageupload" listed for update is not installed. Ignoring.
and
Package "laravelcollective/html" listed for update is not installed. Ignoring
To solve it I manually added another require array in json added packages to be installed which is given below.
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
}
My modified composer.json file look like this.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*"
},
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
and ran the following command.
composer update
It did the trick for me.
Currently stumped on a test that is returning a 503 error for no reason. Running Laravel 5.1 and latest PHPUnit.
The test:
$this->call('GET', '/about');
$this->assertResponseStatus(200);
Fails because it returns a 503 error, other tests (similar GET calls) pass.
If I dd($this->call()) I can see the entire html response is returned but still has a 503 error attached. No errors in the logs either. The page loads fine in a browser, no 503 error.
edit:
Route::group(array('after' => 'cache:1440'), function() {
Route::get('about', 'HomeController#showAbout');
}
edit2:
dd($this->call('GET', '/about'));
yields full html+
version: "1.1"
statusCode: 503
statusText: "Service Unavailable"
charset: null
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"laravelcollective/html": "~5.0",
"intervention/image": "dev-master",
"watson/sitemap": "2.0.*",
"rap2hpoutre/laravel-log-viewer": "dev-master",
"barryvdh/laravel-httpcache": "0.2.x#dev",
"guzzlehttp/guzzle": "~5.3|~6.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database",
"app/Http/Controllers",
"app/Models",
"app/Helpers"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true
}
Alright I found the issue for some reason flushing and clearing the cache did not work for the barryvdh\laravel-httpcache library, I had to manually delete everything under storage/httpcache
I created a brand new Laravel 5 application via laravel new mysite. When I open the site I see the following errors:
Notice: date_default_timezone_set(): Timezone ID '' is invalid in /mysite/storage/framework/compiled.php on line 1790
Fatal error: Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler() in /mysite/storage/framework/compiled.php on line 1656
Here is my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
I've already ran composer update to make sure I have the latest dependencies, but I'm still getting the same error. Any ideas?
Edit: I'm using PHP 5.4
Edit 2: It works when running via php artisan serve but not when using my my dev box running apache to serve the site. So it could be a local php issue on that box.
I believe this issue has to do with your local server settings. I had the same issue on my local server and I set the value date.timezone in my php.ini
I'm having trouble upgrading to 4.1.
I've followed the upgrade guide in the docs but when I run composer update, I get the following error:
Script php artisan clear-compiled handling the post-update-cmd event returned with an error
PHP Fatal error: Call to undefined method
Illuminate\Foundation\Application::bindShared() in
/site/vendor/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php
on line 26
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call
to undefined method
Illuminate\Foundation\Application::bindShared()","file":"/site/vendor/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php","line":26}}Script
php artisan clear-compiled handling the post-update-cmd event returned
with an error
[RuntimeException]
Error Output: PHP Fatal error: Call to undefined method
Illuminate\Foundat ion\Application::bindShared() in /site/vendor
/laravel/framework/src/Illuminate/Queue/FailConsoleServiceProvider.php
on l ine 26
However, if I create a new project and use the same composer.json file, it runs successfully.
Can anyone point me in the right direction?
Here is the contents of my composer.json file:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.1.*",
"anahkiasen/html-object": "dev-master",
"anahkiasen/former": "dev-master",
"laravelbook/ardent": "dev-master",
"nesbot/Carbon": "*",
"jasonlewis/basset": "dev-master",
"robclancy/presenter": "1.1.*",
"way/generators": "dev-master",
"baum/baum": "dev-develop",
"loic-sharma/profiler": "1.1.*",
"thapp/jitimage": "dev-master",
"way/generators": "dev-master",
"jasonlewis/basset": "dev-master",
"cartalyst/sentry": "2.0.*",
"edvinaskrucas/notification": "1.*",
"laravelbook/ardent": "dev-master",
"orangehill/iseed": "dev-master",
"greggilbert/recaptcha": "dev-master",
"zizaco/factory-muff": "dev-master",
"mockery/mockery": "dev-master",
"way/phpunit-wrappers": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev"
}
Quick update. I've got it to work now. I had a few packages in my workbench directory which each had their own composer.json file. I had to update the require section to read:
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.*"
},