<?php

namespace TPS\Shop\Repositories;

use TPS\Shop\Models\WebsiteReview;

class WebsiteReviewRepository
{

    public function create($data)
    {
        $websiteReview = WebsiteReview::create([
            'customer_id' => $data['customer_id'],
            'review_text' => $data['web_review_text'],
            'rating' => $data['web_review_rating']
        ]);
    
        return $websiteReview ? true : false;
    }

    public function paginate($perPage)
    {
        return WebsiteReview::with('customer')
            ->orderBy('created_at', 'desc')
            ->paginate($perPage);
    }

}