1. Go to this page and download the library: Download mozex/laravel-campaigns 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/ */
namespace App\Campaigns;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Mozex\Campaigns\Contracts\ListSource;
class AccountList implements ListSource
{
public function name(): string
{
return 'Accounts';
}
public function query(): Builder
{
return User::query();
}
public function isEligible(Model $record): bool
{
return $record->banned_at === null;
}
public function fields(Model $record): array
{
return ['email' => $record->email, 'name' => $record->name];
}
}