Payment.php
TLDR
This file contains the definition of the Payment
class, which is a model representing a payment in the shop. It extends the Model
class and uses the HasFactory
trait. It also has a belongsTo
relationship with the Order
class.
Classes
Payment
The Payment
class is a model representing a payment in the shop. It extends the Model
class and uses the HasFactory
trait. It is associated with the shop_payments
table in the database. It has a belongsTo
relationship with the Order
class.
<?php
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Payment extends Model
{
use HasFactory;
protected $table = 'shop_payments';
protected $guarded = [];
public function order(): BelongsTo
{
return $this->belongsTo(Order::class);
}
}