1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Repositories\Models\Exam;
- use App\Repositories\Models\Base\Admin;
- use App\Repositories\Models\Model;
- class Record extends Model
- {
- /**
- * @var string
- */
- protected $table = 'exam_records';
- protected $guarded = [];
- /**
- * The attributes excluded from the model's JSON form.
- *
- * @var array
- */
- protected $hidden = [];
- protected $casts = [
- 'result' => 'json',
- 'banks' => 'json',
- ];
- public function paper()
- {
- return $this->belongsTo(Paper::class)->select(['id', 'name']);
- }
- public function admin()
- {
- return $this->belongsTo(Admin::class)->with(['shop'])->select(['id', 'name', 'username','shop_id']);
- }
- }
|