Looking to hire Laravel developers? Try LaraJobs

laravel-helpers maintained by ahs-composer

Description
A collection of helper functions for Laravel
Author
Ali Haider
Last update
2024/05/28 15:34 (dev-master)
Links
Downloads
9

Comments
comments powered by Disqus

Laravel Helpers

A collection of helper functions for Laravel, created by Ali Haider.

Installation

You can install this package via Composer. Run the following command in your terminal:

composer require ahs-composer/laravel-helpers

Usage

Autoloading

This package utilizes PSR-4 autoloading, so make sure to add the following line to your composer.json file if it's not already present:

"autoload": {
    "psr-4": {
        "Ahs\\LaravelHelpers\\": "LaravelHelpers/src/"
    }
}

Helper Functions

The package provides the following helper functions:

Example

Here's an example of how you can use the helper functions:

use Ahs\LaravelHelpers\Helpers;

// Example usage
$slug = Helpers::slugify("Hello World!");
$truncated = Helpers::truncate("Lorem ipsum dolor sit amet", 10);
$date = Helpers::format_date("2024-05-30", "Y-m-d");