This package provides handy utilities for Laravel applications.
branch | status |
---|---|
main | |
staging | |
dev |
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(),
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 a string to a
CarbonInterval
instance using thecarbon-interval
cast.
use Illuminate\Database\Eloquent\Model;
use InternetGuru\LaravelCommon\Casts\CarbonIntervalCast;
class Task extends Model
{
protected $casts = [
'duration' => CarbonIntervalCast::class,
];
}
To run the tests, use the following command:
./vendor/bin/phpunit
This package uses Orchestra Testbench to bootstrap a minimal Laravel environment for testing.
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.