EscolaLMS/Cart

View on GitHub
src/Http/Requests/PaymentProductRequest.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace EscolaLms\Cart\Http\Requests;

use EscolaLms\Cart\Models\Product;

class PaymentProductRequest extends PaymentRequest
{

    public function getProductId(): int
    {
        return (int) $this->route('id');
    }

    public function getProduct(): Product
    {
        /** @var Product $product */
        $product = Product::findOrFail($this->getProductId());
        return $product;
    }
}