<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\User;
use App\Models\Service;

class Order extends Model
{
    use HasFactory;

	protected $fillable = [
		'quantity', 'url'
	];

	public function service() {
		return $this->belongsTo(Service::class);
	}

	public function user() {
		return $this->belongsTo(User::class);
	}

	public function getServiceNameAttribute() {
		return $this->service()->name();
	}

}
