LaravelCollective / html

HTML and Form Builders for the Laravel Framework
MIT License
3.99k stars 802 forks source link

No placeholder displayed on select #74

Closed cyrildally closed 9 years ago

cyrildally commented 9 years ago

Hello team, I'm having an issue with Form::select as no placeholder is displayed while it is correctly set up in my blade (exactly copy-pasted from 5.1 doc). Does anyone encounter this problem?

Below a piece of code of my blade + my app configuration and my composer installed components:

I am using Laravel 5.1.

Form blade: {!! Form::model($advert, ['route' => ['cms.adverts.update', $advert->id], 'method' => 'put', 'class' => 'form-horizontal panel', 'files' => true]) !!}

{!! Form::select('size', array('L' => 'Large', 'S' => 'Small'), null, ['placeholder' => 'Pick a size...']) !!}

{!! Form::submit('Edit', ['class' => 'btn btn-primary pull-right']) !!} {!! Form::close() !!}

Config: <?php

return [ 'debug' => env('APP_DEBUG', true), 'url' => 'http://localhost', 'timezone' => 'Europe/Rome', 'locale' => 'it', 'fallback_locale' => 'en', 'key' => env('APP_KEY', 'fooKey'), 'cipher' => 'fooCypher', 'log' => 'single', 'providers' => [ Illuminate\Foundation\Providers\ArtisanServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Bus\BusServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Routing\ControllerServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class, Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class, Illuminate\Mail\MailServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class, Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, Illuminate\Session\SessionServiceProvider::class, Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class, Illuminate\View\ViewServiceProvider::class, App\Providers\AppServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, Collective\Html\HtmlServiceProvider::class, Intervention\Image\ImageServiceProvider::class, ], 'aliases' => [ 'App' => Illuminate\Support\Facades\App::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Auth' => Illuminate\Support\Facades\Auth::class, 'Blade' => Illuminate\Support\Facades\Blade::class, 'Bus' => Illuminate\Support\Facades\Bus::class, 'Cache' => Illuminate\Support\Facades\Cache::class, 'Config' => Illuminate\Support\Facades\Config::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class, 'DB' => Illuminate\Support\Facades\DB::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Event' => Illuminate\Support\Facades\Event::class, 'File' => Illuminate\Support\Facades\File::class, 'Form' => Collective\Html\FormFacade::class, 'Hash' => Illuminate\Support\Facades\Hash::class, 'Html' => Collective\Html\HtmlFacade::class,
'Image' => Intervention\Image\Facades\Image::class, 'Input' => Illuminate\Support\Facades\Input::class, 'Inspiring' => Illuminate\Foundation\Inspiring::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, 'Password' => Illuminate\Support\Facades\Password::class, 'Queue' => Illuminate\Support\Facades\Queue::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class, 'Redis' => Illuminate\Support\Facades\Redis::class, 'Request' => Illuminate\Support\Facades\Request::class, 'Response' => Illuminate\Support\Facades\Response::class, 'Route' => Illuminate\Support\Facades\Route::class, 'Schema' => Illuminate\Support\Facades\Schema::class, 'Session' => Illuminate\Support\Facades\Session::class, 'Storage' => Illuminate\Support\Facades\Storage::class, 'URL' => Illuminate\Support\Facades\URL::class, 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, ], ];

Output from composer show --installed: classpreloader/classpreloader 2.0.0 Helps class loading performanc... danielstjules/stringy 1.9.0 A string manipulation library ... dnoegel/php-xdg-base-dir 0.1 implementation of xdg base dir... doctrine/inflector v1.0.1 Common String Manipulations wi... doctrine/instantiator 1.0.5 A small, lightweight utility t... fzaninotto/faker v1.5.0 Faker is a PHP library that ge... guzzlehttp/psr7 1.1.0 PSR-7 message implementation hamcrest/hamcrest-php v1.2.2 This is the PHP port of Hamcre... intervention/image 2.3.1 Image handling and manipulatio... jakub-onderka/php-console-color 0.1
jakub-onderka/php-console-highlighter v0.3.2 jeremeamia/SuperClosure 2.1.0 Serialize Closure objects, inc... laravel/framework v5.1.7 The Laravel Framework. laravelcollective/html v5.1.2 league/flysystem 1.0.9 Filesystem abstraction: Many f... mockery/mockery 0.9.4 Mockery is a simple yet flexib... monolog/monolog 1.15.0 Sends your logs to files, sock... mtdowling/cron-expression v1.0.4 CRON for PHP: Calculate the ne... nesbot/carbon 1.20.0 A simple API extension for Dat... nikic/php-parser v1.4.0 A PHP parser written in PHP phpdocumentor/reflection-docblock 2.0.4
phpspec/php-diff v1.0.2 A comprehensive library for ge... phpspec/phpspec 2.2.1 Specification-oriented BDD fra... phpspec/prophecy v1.4.1 Highly opinionated mocking fra... phpunit/php-code-coverage 2.1.8 Library that provides collecti... phpunit/php-file-iterator 1.4.0 FilterIterator implementation ... phpunit/php-text-template 1.2.1 Simple template engine. phpunit/php-timer 1.0.6 Utility class for timing phpunit/php-token-stream 1.4.3 Wrapper around PHP's tokenizer... phpunit/phpunit 4.7.7 The PHP Unit Testing framework. phpunit/phpunit-mock-objects 2.3.5 Mock Object library for PHPUnit psr/http-message 1.0 Common interface for HTTP mess... psr/log 1.0.0 Common interface for logging l... psy/psysh v0.5.2 An interactive shell for moder... sebastian/comparator 1.1.1 Provides the functionality to ... sebastian/diff 1.3.0 Diff implementation sebastian/environment 1.2.2 Provides functionality to hand... sebastian/exporter 1.2.0 Provides the functionality to ... sebastian/global-state 1.0.0 Snapshotting of global state sebastian/recursion-context 1.0.0 Provides functionality to recu... sebastian/version 1.0.6 Library that helps with managi... swiftmailer/swiftmailer v5.4.1 Swiftmailer, free feature-rich... symfony/console v2.7.2 Symfony Console Component symfony/css-selector v2.7.2 Symfony CssSelector Component symfony/debug v2.7.2 Symfony Debug Component symfony/dom-crawler v2.7.2 Symfony DomCrawler Component symfony/event-dispatcher v2.7.2 Symfony EventDispatcher Component symfony/finder v2.7.2 Symfony Finder Component symfony/http-foundation v2.7.2 Symfony HttpFoundation Component symfony/http-kernel v2.7.2 Symfony HttpKernel Component symfony/process v2.7.2 Symfony Process Component symfony/routing v2.7.2 Symfony Routing Component symfony/translation v2.7.2 Symfony Translation Component symfony/var-dumper v2.7.2 Symfony mechanism for explorin... symfony/yaml v2.7.2 Symfony Yaml Component vlucas/phpdotenv v1.1.1 Loads environment variables fr...

Extract from my composer.json: ....... "require": { "php": ">=5.5.9", "laravel/framework": "5.1.", "laravelcollective/html": "5.1.", "intervention/image": "^2.3" }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, .......

Can someone help me or indicate me what I am doing wrong? Thanks for your help in advance, CDF

cyrildally commented 9 years ago

Solved. Sorry for that! If it might help, I just added "illuminate/html":"5.0.*" in my composer.json and run a composer install and it solved it. You can close it, Have a nice day!