44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
||||
|
|
|
|||
|
|
namespace App\Models;
|
|||
|
|
|
|||
|
|
use Illuminate\Database\Eloquent\Model;
|
|||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|||
|
|
|
|||
|
|
class EarnTaskResult extends Model
|
|||
|
|
{
|
|||
|
|
protected $guarded = [];
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Sonucun sunucu tarafından doğrulanmış görev atamasını döndürür.
|
|||
|
|
*
|
|||
|
|
* @author Gökhan Engin - İletişim : https://bit.ly/YazılımUzmanı
|
|||
|
|
*/
|
|||
|
|
public function assignment(): BelongsTo
|
|||
|
|
{
|
|||
|
|
return $this->belongsTo(EarnTaskAssignment::class, 'earn_task_assignment_id');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Sonucun ait olduğu normal müşteri kullanıcısını döndürür.
|
|||
|
|
*
|
|||
|
|
* @author Gökhan Engin - İletişim : https://bit.ly/YazılımUzmanı
|
|||
|
|
*/
|
|||
|
|
public function user(): BelongsTo
|
|||
|
|
{
|
|||
|
|
return $this->belongsTo(User::class);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
* Sonuç alanlarını güvenli PHP türlerine dönüştürür.
|
|||
|
|
*
|
|||
|
|
* @return array<string, string>
|
|||
|
|
*
|
|||
|
|
* @author Gökhan Engin - İletişim : https://bit.ly/YazılımUzmanı
|
|||
|
|
*/
|
|||
|
|
protected function casts(): array
|
|||
|
|
{
|
|||
|
|
return ['completed' => 'boolean', 'submitted_at' => 'datetime'];
|
|||
|
|
}
|
|||
|
|
}
|