PHP code example of wfeller / laravel-batch
1. Go to this page and download the library: Download wfeller/laravel-batch library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wfeller / laravel-batch example snippets
php
class Car extends \Illuminate\Database\Eloquent\Model
{
use \WF\Batch\Traits\Batchable;
// ...
}
// This allows you to call
Car::newBatch($cars)->save()->now();
// which is the same as
Batch::of(Car::class, $cars)->save()->now();
php
User::insert([$userA, $userB, $userC]);
php
$users = [$userA, $userB, $userC];
foreach ($users as $user)
{
User::create($user);
}