This composer.json configuration seems to work in my application.
"repositories": [ { "type": "git", "url": "https://github.com/formers/former.git" } ], "require": { "laravel/lumen-framework": "5.0.*", "vlucas/phpdotenv": "~1.0", "anahkiasen/former": "4.0.x-dev" },
After that do:
composer update -vvv
I am updating my bootstrap/app.php :
Testing in app/Http/routes.php :
use Former\Facades\Former; $app->get('/', function() use ($app) { echo Former::open()->method('GET'); echo Former::text('name')->required(); echo Former::close(); });
Output:
<form accept-charset="utf-8" class="form-horizontal" method="GET"> <div class="form-group required"> <label for="name" class="control-label col-lg-2 col-sm-4">Name<sup>*</sup></label> <div class="col-lg-10 col-sm-8"> <input class="form-control" required="true" id="name" type="text" name="name"> </div> </div> </form>
Everything looks good. I think the problem is outdated packages.
Update
I am changing my app/Http/routes.php to something like this:
$app->get('/', function() use ($app) { return view('foo'); });
And this is my foo.blade.php :
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Foo</title> </head> <body> {!! Former\Facades\Former::open()->method('GET'); !!} {!! Former\Facades\Former::text('name')->required(); !!} {!! Former\Facades\Former::close(); !!} </body> </html>
And it works.
Alfa
source share