I am trying to enable html forms in laravel 5.2 so I can do something like this in my blade.php files.
<img src="{{ Html::image('Joe_Icon.png')}}" style="width:160px;height:100px;">
When I tried this initially I got an error that said Html was not found. I have added the following lines to my app.php file in the config folder, in the aliases array.
'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,
This is in my app.php file in the providers array.
Collective\Html\HtmlServiceProvider::class,
Unfortunately now I get an error that says Class 'Collective\Html\HtmlServiceProvider not found. I have also used the command composer update and my composer is up to date so that is not the issue.
Here is my full composer.json file
{
"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": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
composer.json
above looks odd, you should have a lot more in therequire
section for a Laravel app. Do you possibly have tworequire
sections? – jszobodycomposer dump-autoload
after the update? It's not necessary, but it's worth trying – Damien Pirsy