Download the PHP package ellgreen/laravel-loadfile without Composer

On this page you can find all versions of the php package ellgreen/laravel-loadfile. 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-loadfile

Laravel Load File 💽

A package to help with loading files into MySQL tables.

This uses MySQL's LOAD DATA statement to load text files quickly into your database.

This is usually 20 times faster than using INSERT statements according to: https://dev.mysql.com/doc/refman/8.0/en/insert-optimization.html

Options

This library currently can handle any of the options in a normal LOAD DATA statement except for the partitioned table support. This will be included in a future release of laravel-loadfile.

Further information on the following options that can be passed to the load file builder can be found here:

https://dev.mysql.com/doc/refman/8.0/en/load-data.html

Installation

Requires >= PHP 8.2 and >= Laravel 12

Older versions of Laravel and PHP are supported through previous major versions of this library

Loading files

To use local files you will need to have local_infile enabled for the client and server. To do this on the Laravel side you will need to add the following to the options part of your database config:

Simple file import

Ignoring header row

Specifying field options

Specifying line options

Input preprocessing (set)

Using a different connection

Duplicate-key and error handling

Loading data into Eloquent Models

Simply add the LoadsFiles trait to your model like so:

Then you can use the following method to load a file into that table:

Need to specify options to load the file with?

Add the following method to your Model

Or you can get an instance of the query builder on the fly

Development

Check

Runs linting, static analysis, and unit tests.

All tests

Runs unit and feature tests against all support Laravel versions.

You will need to have docker installed for these.


All versions of laravel-loadfile with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^12.0
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 ellgreen/laravel-loadfile contains the following files

Loading the files please wait ....