Download the PHP package laracraft-tech/laravel-useful-traits without Composer

On this page you can find all versions of the php package laracraft-tech/laravel-useful-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-useful-traits

A collection of useful Laravel additions!

Latest Version on Packagist Tests Check & fix styling License Total Downloads

Here we will share some useful Laravel additions we need in our daily work.

Traits

Commands

Installation

You can install the package via composer:

Then publish the config file with:

Traits

UsefulEnums

This trait is only available with PHP 8.1 or higher installed.


names, values, array

This could be very handy if you like to loop over all of your enum types, or you maybe want to use the enum as an array, for instance in a migration.

UsefulScopes


selectAllBut

Select all columns but given excluded array.

Note: Since you can't do a native "select all but x,y,z" in mysql, we need to query (and cache) the existing columns of the table, and then exclude the given columns which should be ignored (not selected) from the existing columns.

Cache: Column names of each table will be cached until contents of migrations directory is added or deleted. Modifying the contents of files inside the migrations directory will not re-cache the columns. Consider to clear the cache whenever you make a new deployment/migration!


fromToday, fromYesterday

Select all entries created today or yesterday.

RefreshDatabaseFast


This is a trait which makes the migration of your database in your test suite much, much faster! The base idea comes from Mayahi. It basically only migrates your database if the migration files has changed. So the first migrate:fresh takes a while (depending on how many migrations you have), and then it's incredible fast.

Optionally you can set USEFUL_ADDITIONS_SEED_AFTER_FAST_DB_REFRESH to true if you like to seed your database after the migration.

Also make sure to add the .phpunit.database.checksum to your .gitignore file!

Pest:

PHPUnit:

Commands

db:truncate


This command truncates all the tables of your current database connection. Checkout --help to see arguments and options. It for instance, lets you also truncate only specific tables or disable foreigen key checks or maybe run in force mode.

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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


All versions of laravel-useful-traits with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/database Version ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^9.0 || ^10.0 || ^11.0
illuminate/testing Version ^9.0 || ^10.0 || ^11.0
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0
spatie/laravel-package-tools Version ^1.12 || ^1.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package laracraft-tech/laravel-useful-traits contains the following files

Loading the files please wait ....