PATH:
home
/
lab2454c
/
omvstudio.com
/
app
/
Models
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Movie extends Model { use HasFactory; protected $fillable = [ 'title', 'slug', 'price', 'movie_length', 'description', 'star_cast', 'passcode', 'cover_image', 'trailer', 'video_upload', ]; public function categories() { return $this->belongsToMany(Category::class, 'category_movie'); } public function payments() { return $this->hasMany(Payment::class); } public function reviews() { return $this->hasMany(Review::class); } public function Check24Hrs() { //($this->payments->sortByDesc('payment_validity')->first()); if (!empty($this->payments->sortByDesc('created_at')->first()) AND ($this->payments->sortByDesc('created_at')->first()->payment_validity > \Carbon\Carbon::now())) { return true; } else { return false; } } public function users() { return $this->belongsToMany(User::class,'movie_user')->withPivot('created_at','updated_at'); } }
[-] Message.php
[edit]
[-] Entertain.php
[edit]
[-] Review.php
[edit]
[+]
..
[-] HomeConfigWork.php
[edit]
[-] Category.php
[edit]
[-] MusicMania.php
[edit]
[-] Faq.php
[edit]
[-] Sport.php
[edit]
[-] Contact.php
[edit]
[-] Page.php
[edit]
[-] Media.php
[edit]
[-] Payment.php
[edit]
[-] Music.php
[edit]
[-] User.php
[edit]
[-] SiteSetting.php
[edit]
[-] PageBanner.php
[edit]
[-] BankDetail.php
[edit]
[-] ReferralPayment.php
[edit]
[-] Movie.php
[edit]
[-] Role.php
[edit]