| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- /**
- * @property-read \App\Models\Cart|null $cart
- * @property-read \App\Models\Schedule|null $schedule
- * @method static \Illuminate\Database\Eloquent\Builder<static>|CartItem newModelQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|CartItem newQuery()
- * @method static \Illuminate\Database\Eloquent\Builder<static>|CartItem query()
- * @mixin \Eloquent
- */
- class CartItem extends Model
- {
- use HasFactory;
- protected $table = 'cart_items';
- protected $fillable = [
- 'cart_id',
- 'schedule_id',
- ];
- protected $casts = [
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- ];
- public function cart()
- {
- return $this->belongsTo(Cart::class);
- }
- public function schedule()
- {
- return $this->belongsTo(Schedule::class);
- }
- }
|