initial: bootstrap from BukidBountyApp base
This commit is contained in:
51
app/Models/Market/CooperativeResolution.php
Normal file
51
app/Models/Market/CooperativeResolution.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models\Market;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\User;
|
||||
|
||||
class CooperativeResolution extends Model
|
||||
{
|
||||
protected ?string $table = 'cooperative_resolutions';
|
||||
|
||||
protected array $fillable = [
|
||||
'hashkey',
|
||||
'organization_id',
|
||||
'title',
|
||||
'description',
|
||||
'date_approved',
|
||||
'document_url',
|
||||
'status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'date_approved' => 'date',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
|
||||
public function organization()
|
||||
{
|
||||
return $this->belongsTo(Organization::class, 'organization_id');
|
||||
}
|
||||
|
||||
public function votes()
|
||||
{
|
||||
return $this->hasMany(CooperativeVote::class, 'resolution_id');
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function updater()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'updated_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user