PHP code example of laraveldaily / laravel-html

1. Go to this page and download the library: Download laraveldaily/laravel-html library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laraveldaily / laravel-html example snippets


html()->span()->text('Hello world!')->class('fa fa-eye');

{{ html()->form('PUT', '/post')->open() }}

{{ html()->email('email')->placeholder('Your e-mail address') }}

{{ html()->form()->close() }}

{{ html()->modelForm($user)->open() }}

{{ html()->input('name') }}

{{ html()->closeModelForm() }}

// config/app.php
'providers' => [
    ...
    Spatie\Html\HtmlServiceProvider::class,
];

// config/app.php
'aliases' => [
    ...
    'Html' => Spatie\Html\Facades\Html::class,
];

html()->span()->text('Hello world!');

$icon = html()->span()->class('fa');

$icon->class('fa-eye'); // '<span class="fa fa-eye"></span>'
$icon->class('fa-eye-slash'); // '<span class="fa fa-eye-slash"></span>'

// This will try to resolve an initial value, and fall back to '[email protected]'
$email = html()->email('email', '[email protected]');

// This will always have '[email protected]' as it's value
$email = html()->email('email')->value('[email protected]');