laravel-utils maintained by mll-lab
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- php ^8.2
- illuminate/support ^11 || ^12
- thecodingmachine/safe ^1 || ^2 || ^3
- mll-lab/php-utils ^5.2 || ^6
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- mll-lab/php-utils ^5.2 || ^6
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2 || ^6
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2 || ^6
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2 || ^3
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11 || ^12
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^11
- mll-lab/php-utils ^5.2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.2
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4 || ^5
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3 || ^4
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2 || ^3
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13 || ^2
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/php-utils ^1.13
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/str_putcsv ^1
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10 || ^11
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51 || ^10
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1 || ^2
- php ^8.1
- illuminate/support ^9.51
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1
- php ^8.1
- illuminate/support ^9.51
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1
- php ^8.1
- illuminate/support ^9.51
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1
- php ^8.1
- illuminate/support ^8.73 || ^9.45
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1
- php ^8.1
- illuminate/support ^8.73 || ^9.45
- mll-lab/str_putcsv ^1
- nesbot/carbon ^2.64
- ramsey/uuid ^4.7
- thecodingmachine/safe ^1
- php ^7.4 || ^8
- illuminate/support ^8.73 || ^9
- mll-lab/str_putcsv ^1
- thecodingmachine/safe ^1
laravel-utils
Shared Laravel utilities of MLL
Installation
Install through composer
composer require mll-lab/laravel-utils
Usage
See tests.
Autoincrement
Allows the creation of incrementing IDs without actually using autoincrement.
Extend the class Autoincrement with a descriptive name for your ID.
use MLL\LaravelUtils\Database\Autoincrement;
final class MaxFooID extends Autoincrement
{
public static function name(): string
{
return 'max_foo_id';
}
}
Generate a migration and call the createTable() method in it:
public function up(): void
{
MaxFooID::createTable();
}
To use this ID in your model, set $incrementing to false and assign the ID to your model in the booted() method:
public $incrementing = false;
protected static function booted(): void
{
self::creating(function (self $instance): void {
$instance->id ??= MaxFooID::next();
});
Conditional Migrations
To run a migration conditionally, implement the MLL\LaravelUtils\Database\ConditionalMigration
interface and its ->shouldRun() method in your migration:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Carbon;
use MLL\LaravelUtils\Database\ConditionalMigration
return new class extends Migration implements ConditionalMigration {
public function up(): void
{
// Something that would put intense strain on the database
}
public function shouldRun(): bool
{
$currentHour = Carbon::now()->hour;
// Only run between 01:00 and 03:00
return $currentHour > 1 && $currentHour < 3;
}
};
Strict Stubs
To continually keep your stubs updated with the latest and greatest from this package,
add /stubs to your .gitignore and add the following to your composer.json:
"scripts": {
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
+ "@php artisan vendor:publish --tag=strict-stubs --force"
]
}
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
License
This package is licensed using the MIT License.