Skip to content

internetguru/laravel-common

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Common

This package provides handy utilities for Laravel applications.

branch status
main tests
staging tests
dev tests

Installation

You can install the package via Composer:

composer require internetguru/laravel-common

Create aliases for the package classes in the config/app.php file:

    use Illuminate\Support\Facades\Facade;

    'aliases' => Facade::defaultAliases()->merge([
        'Helpers' => InternetGuru\LaravelCommon\Support\Helpers::class,
    ])->toArray(),

Usage

Helpers

You can use the Helpers class methods, such as getAppInfoArray and getAppInfo, to get information about the application.

<meta name="generator" content="{{ Helpers::getAppInfo() }}"/>

For more available methods, please refer to the Helpers class.

Casts

Carbon Interval

Casts a string to a CarbonInterval instance using the carbon-interval cast.

use Illuminate\Database\Eloquent\Model;
use InternetGuru\LaravelCommon\Casts\CarbonIntervalCast;

class Task extends Model
{
    protected $casts = [
        'duration' => CarbonIntervalCast::class,
    ];
}

Testing

To run the tests, use the following command:

./vendor/bin/phpunit

This package uses Orchestra Testbench to bootstrap a minimal Laravel environment for testing.

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages