Composer package which adds support for HTML5 elements using Laravels Form interface (e.g. Form::date())

Related tags

Laravel html5inputs
Overview

Laravel HTML 5 Inputs

Build Status License Version Packagist

Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date())

Adds support for: color, date, datetime, datatime-local, month, number, range, search, tel, time, week. Laravel Form interfce supports Email & Url out of the box.

This package allows you to use HTML5 inputs the same way as normal text fields Form::color('inputName');

Upgrade From v1

  1. In your composer.json file, update the require line for this package to 2.*
"require": {
    "smalldogs/html5inputs": "2.*"
},
  1. In your command line, run composer update.

  2. Follow Step 2 below.

New Installation

  1. On your command line
composer require "smalldogs/html5inputs:2.*"
  1. REPLACE the form alias with the new, extended facade, in app/config/app.php.
'aliases' => array(
      'Form'            => 'Smalldogs\Html5inputs\Html5InputsFacade',
//  'Form'            => 'Illuminate\Support\Facades\Form',
};
  1. Add the service provider to your app/config/app.php providers array
'providers' => array(
    'Smalldogs\Html5inputs\Html5InputsServiceProvider',
);

How to Use

Just like your normal Form interface.

// Create a date field
Form::date('yourBirthday');

// Create a pre-populated month field for June 2014
Form::month('hottestMonth', '2014-06');

// Create an empty input with bootstrap styles
Form::search('searchBox', null, ['class' => 'form-control']);

// Auto-associate label with input (use the same name)
Form::label('favoriteColor', 'Select Your Favorite Color');
Form::color('favoriteColor', '#FFAE25');


// Use Form-model binding
$user = new User();
$user->phoneNumber = '123-555-5555';
{{ Form::model($user) }}
    {{ Form::label('phoneNumber', 'Update Your Phone #') }}
    {{ Form::tel('phoneNumber') }}
{{ Form::close() }}

Changes from v1

The major difference between v1 and v2 is how the Form class is extended. Version 1 made use of the Form::macro method, while v2 creates a Facade which extends \Illuminate\Support\Facades\Form directly.

This allows for more direct similarity between the handling of the new methods and the default methods ( such as "text" or "email").

This also enables Form Model Binding with the new HTML5 elements.

You might also like...
📦 Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.
📦 Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.

Laravel Package Support for Lumen: Makes Lumen compatible with Laravel Packages. You can use any Laravel Packages in Lumen by installing Larasupport Package.

GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn
GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation in PHP (API) 😍 😍 😍 This package helps you to know a lot of information about the current user by his ip address 😍 😍 😍 This package h

Laravel Livewire (TALL-stack) form generator with realtime validation, file uploads, array fields, blade form input components and more.
Laravel Livewire (TALL-stack) form generator with realtime validation, file uploads, array fields, blade form input components and more.

TALL-stack form generator Laravel Livewire, Tailwind forms with auto-generated views. Support Contributions Features This is not an admin panel genera

A Laravel clone of the Javascript Flatpickr (Date picker) library
A Laravel clone of the Javascript Flatpickr (Date picker) library

A Laravel clone of the Javascript Flatpickr (Date picker) library Using this package you can add a beautiful date or datetime picker into your project

Laravel Seeable - Keep track of the date and time a user was last seen.

Laravel Seeable This package makes it easy to keep track of the date and time a user was last seen. Installation Install this package. composer requir

Tool to convert from composer.yml to composer.json.

composer-yaml This project allows you to convert a composer.yml file into composer.json format. It will use those exact filenames of your current work

A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

Reactive Form Builder for Vue.js with Laravel Support
Reactive Form Builder for Vue.js with Laravel Support

Dynamic Form Builder for Laravel with Vue.js Create even the most complex forms with ease, using two-sided validation, eloquent, nested elements, cond

A Laravel package that adds a simple image functionality to any Laravel model
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Comments
  • Date Field does not auto fill if null

    Date Field does not auto fill if null

    If I being the Form to a model and use the normal Laravel inputs IE Form::text('mydate', null, array..... Laravel autofills the field using either the Old data or the database data,

    If I use your Date macro, I have to do that manually... is it possible for a Macro to autofill the fields the way Laravel does?

    opened by bgies 1
  • Problem on Composer require for Laravel 5.1

    Problem on Composer require for Laravel 5.1

    Hi there, I'm not sure what's the issue, but I got this upon running the

    composer require "smalldogs/html5inputs:2.*"
    

    This is what I've got:

      Problem 1
        - Conclusion: remove laravel/framework v5.1.26
        - Conclusion: don't install laravel/framework v5.1.26
        - smalldogs/html5inputs v2.0 requires illuminate/support 4.2.* -> satisfiable by illuminate/support[v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
        - smalldogs/html5inputs v2.1 requires illuminate/support 4.2.* -> satisfiable by illuminate/support[v4.2.1, v4.2.12, v4.2.16, v4.2.17, v4.2.2, v4.2.3, v4.2.4, v4.2.5, v4.2.6, v4.2.7, v4.2.8, v4.2.9].
        - don't install illuminate/support v4.2.1|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.12|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.16|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.17|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.2|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.3|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.4|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.5|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.6|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.7|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.8|don't install laravel/framework v5.1.26
        - don't install illuminate/support v4.2.9|don't install laravel/framework v5.1.26
        - Installation request for laravel/framework == 5.1.26.0 -> satisfiable by laravel/framework[v5.1.26].
        - Installation request for smalldogs/html5inputs 2.* -> satisfiable by smalldogs/html5inputs[v2.0, v2.1].
    
    

    Does this have to do with the Laravel version compatibility?

    opened by clintentorum 1
  • Laravel 5 support

    Laravel 5 support

    In order to make this package work with Laravel 5, I had to change one line in Html5InputsFacade.php

    This line: class Html5InputsFacade extends \Illuminate\Support\Facades\Form { becomes: class Html5InputsFacade extends \Collective\Html\FormFacade {

    Everything works then!

    Could you make a Laravel 5 version?

    opened by paceband 1
Owner
Small Dog Studios
Small Dog Studios
Adds a way to write php and run it directly in Laravels' Artisan Tinker.

Adds a way to write php in PhpStorm/IDEA and run it directly as if through laravel artisan tinker - allowing you to quickly run a piece of code with a

Robbin 120 Jan 2, 2023
A package to flash multiple messages using Laravels default session message flashing system

Flash multiple advanced messages with both text, messages and links An opinionated solution for flashing multiple advanced messages from the backend a

Bilfeldt 6 Jan 18, 2022
A simple API documentation package for Laravel using OpenAPI and Stoplight Elements

Laravel Stoplight Elements Easily publish your API documentation using your OpenAPI document in your Laravel Application. Installation You can install

Steve McDougall 24 Nov 17, 2022
Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology.

Stash View Stash view is a composer package for Laravel which caches views using Russian Doll Caching methodology. What is Russian Doll Caching ? It i

Bhushan Gaikwad 18 Nov 20, 2022
🧾 Online test site with the human sciences theme. Using: HTML5, CSS3, Js., PHP7 and MySQL. 🚀

form-ciencias-humanas ?? Technologies Lunacy HTML5 CSS3 PHP7 MYSQL Animate.css Illustrations from icons8: Earth care from Anna Antipina Earth and Moon

Vinícius 1 Jan 9, 2022
PcTools is a proyect developed using {JavaScript,HTML5,CSS} for frontend and {PHP => Mysql} for backend.

PcTools-Proyect PcTools is a proyect developed using {JavaScript,HTML5,CSS} for frontend and {PHP => Mysql} for backend. Future Improvements # Replace

Ihab Fallahy 1 Feb 5, 2022
A package that adds view-composer like feature to Inertia.js Laravel adapter

Kinetic A package that adds view-composer like feature to Inertia.js Laravel adapter. Use to be able to share props based on the Inertia component nam

Marvin Quezon 76 Dec 12, 2022
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.

Laravel Blade Sortable Demo Repo Installation You can install the package via composer: composer require asantibanez/laravel-blade-sortable After the

Andrés Santibáñez 370 Dec 23, 2022
🎨 Free custom elements for the WordPress plugin Oxygen Builder.

?? Custom Elements for Oxygen Builder Free custom elements for the WordPress plugin Oxygen Builder. If you find the elements useful, click on the star

Simon Vidman 62 Dec 29, 2022