We noticed you're using an ad blocker

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Laravel H package

world cup 2023

WorldCup 2023

Get update standing, score, poll

Get Now

Laravel H is a helper package for Laravel Framework. Helper functions are really a lifesaver and useful for productivity. Making form is common task either we make a website or application and the Laravel H package provides frequently used helper functions &  form builder functions for making HTML form with a clean and easy syntax.

GitHub repository: Laravel H


composer require haruncpi/laravel-h



You can use all helper class method by H::method() or h()->method()


H::isLoggedIn() h()->isLoggedIn()
H::numToWord(12.23) h()->numToWord(12.23)


Available Helper Methods

isLocalhost() - Check app is running on localhost or not.

H::isLocalhost() //output true


isLoggedIn($guard) - Check user is logged in or not. $guard by default null.

H::isLoggedIn() //output false
H::isLoggedIn('customer'); // for specific auth guard //output true


getUsername($guard) - Get the current logged in the user name. $guard by default null.

H::getUsername() //output Jhon Doe


getUserId($guard) - Get the current logged in user id. $guard by default null.

H::getUserId() //output 1


getUserEmail($guard) - Get the current logged in the user email address. $guard by default null.

H::getUserEmail() //output 1


getCurrentUser($guard) - Get the current logged in user. $guard by default null.



toMoney($amount, $decimal = 2) - Get number to a currency format.

//output 200.00
//output 12.57


numberToWord($amount, $option = ['decimal' => 'dollar', 'fraction' => 'cents']) - Get number to words string.

//output two hundred
//output two hundred dollar one two cents


Form Helpers

You can use all class method by F::method() or f()->method()


F::text('name') f()->text('email')
F::email('email') f()->email('email')


Available Form Helper Methods

open($options) - Open form tag.


/** output

<form action="example.com/submit" method="POST">
<input type="hidden" name="_token" value="FwrnW3SOkLHKHsJctWnCeyZrOFtW6UtSHRf5XGrv"/>


close() - Close form tag.

F::close() //output </form>


label($name) - Input label.

F::label('name') //output <label for="name">Name</label>


submit($value, $attr = []) - Form submit button.

F::submit('Save') //output <input type="submit" value="Save"/>


text($name, $value = null, $attr = []) - Form text box.

//output <input type="text" name="first_name"/>

F::text('first_name', $data->name, ['class'=>'form-control'] )
//output <input type="text" name="first_name" value="Jhon Doe" class="form-control"/>


email($name, $value = null, $attr = []) - Form email type input box.

F::email('user_email') //output <input type="email" name="user_email"/>


password($name, $value = null, $attr = []) - Form password type input box.

F::password('password') //output <input type="password" name="password"/>


number($name, $value = null, $attr = []) - Form number type input box.

F::number('roll') //output <input type="number" name="roll"/>


hidden($name, $value = null, $attr = []) - Form hidden input box.

F::number('user_type') //output <input type="hidden" name="user_type"/>


file($name, $value = null, $attr = []) - Form file input.

F::file('photo') //output <input type="file" name="photo"/>


checkbox($name, $value = null, $attr = []) - Form checkbox



radio($name, $value = null, $attr = []) - Form radio button



textarea($name, $value = null, $attr = []) - Form textarea.

F::textarea('description') //output <textarea name="description"></textarea>


select($name,$list,$selected,$attr) - Form select box.

$list = [1 => 'Jhon', 2 => 'Adam'];

/** output
<select name="user_id">
<option value="1">Jhon</option>
<option value="2">Adam</option>


tel($name, $value = null, $attr = []) - Form input for telephone



datetime($name, $value = null, $attr = []) - Form input for datetime



date($name, $value = null, $attr = []) - Form input for date



time($name, $value = null, $attr = []) - Form input for time



week($name, $value = null, $attr = []) - Form input for week



Share on

Related Post - Latest Post

Laravel Barcode generation tutorial

Laravel Query Log

Laravel Jetstream tutorial

Laravel User Activity

Laravel Breeze - Starting with Laravel has been easy!

Laravel API mailer