initial commit
This commit is contained in:
42
app/Models/Contact.php
Normal file
42
app/Models/Contact.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Contact extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\ContactFactory> */
|
||||
use HasFactory;
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'email',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'string',
|
||||
];
|
||||
}
|
||||
}
|
||||
61
app/Models/ContactImport.php
Normal file
61
app/Models/ContactImport.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ContactImportStateEnum;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property string $id
|
||||
* @property \Illuminate\Support\Carbon $queue_at
|
||||
* @property \Illuminate\Support\Carbon|null $started_at
|
||||
* @property \Illuminate\Support\Carbon|null $finished_at
|
||||
* @property int $total_processed
|
||||
* @property int $errors
|
||||
* @property int $duplicates
|
||||
* @property string $file
|
||||
* @property \App\Enums\ContactImportStateEnum $state
|
||||
*/
|
||||
class ContactImport extends Model
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\ContactImportFactory> */
|
||||
use HasFactory;
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'queue_at',
|
||||
'started_at',
|
||||
'finished_at',
|
||||
'total_processed',
|
||||
'errors',
|
||||
'duplicates',
|
||||
'state',
|
||||
'file',
|
||||
];
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'string',
|
||||
'queue_at' => 'datetime',
|
||||
'started_at' => 'datetime',
|
||||
'finished_at' => 'datetime',
|
||||
'state' => ContactImportStateEnum::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user