MovieInfo.php 544 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Models\Movie;
  3. use Illuminate\Database\Eloquent\Model;
  4. class MovieInfo extends Model
  5. {
  6. protected $table = 'tb_movie_info';
  7. protected $primaryKey = 'id';
  8. public $keyType = 'int';
  9. public $incrementing = true;
  10. public $timestamps = true;
  11. const CREATED_AT = 'created_at';
  12. const UPDATED_AT = 'updated_at';
  13. const DELETED_AT = null;
  14. protected $guarded = [];
  15. public function info(string $movieCd): MovieInfo
  16. {
  17. return $this->where('movie_cd', $movieCd)->firstOrNew();
  18. }
  19. }