taylornetwork/laravel-helpers

A collection of Laravel helpers

1.4.0 2018-10-23 03:11 UTC

This package is auto-updated.

Last update: 2024-10-24 11:13:56 UTC


README

A collection of useful helper functions for Laravel. Also will include user created helper functions.

Install

Via Composer

$ composer require taylornetwork/laravel-helpers

Setup

Laravel should automatically discover the package service provider. If that doesn't work for some reason, follow the Manual Setup.

Manual Setup

Only use these steps if Laravel does not auto discover the service provider.

Add the service provider to the providers array in your config/app.php

'providers' => [

	TaylorNetwork\LaravelHelpers\LaravelHelpersServiceProvider::class,

];

Publish Config

$ php artisan vendor:publish

This adds laravel_helpers.php to your config directory

Included Helpers

Click on any of the links to see the helper documentation

Usage

To create a helper function

$ php artisan make:helper HelperName

Will create an app/Helpers directory and add HelperName.php

// app/Helpers/HelperName.php

if(!function_exists('HelperName'))
{
	/**
	 * HelperName 
	 */ 
	function HelperName ()
	{
		// Code
	}
}

This will automatically be included and you can call HelperName() anywhere in your code.

Customization

By default TaylorNetwork\LaravelHelpers\LaravelHelpersServiceProvider will include all helpers included with this package and all helpers found in app\Helpers. You can change this in config/laravel_helpers.php

Credits

License

The MIT License (MIT). Please see License File for more information.