<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Models\Legal\LegalPage;

class LegalPagesController extends Controller
{
    public function refundPolicy()
    {
        return response()->rest(
            LegalPage::where('slug', 'refund-policy')->first(['title', 'content'])
        );
    }

    public function privacyPolicy()
    {
        return response()->rest(
            LegalPage::where('slug', 'privacy-policy')->first(['title', 'content'])
        );
    }

    public function termsOfUse()
    {
        return response()->rest(
            LegalPage::where('slug', 'terms-of-use')->first(['title', 'content'])
        );
    }

    public function shippingPolicy()
    {
        return response()->rest(
            LegalPage::where('slug', 'shipping-policy')->first(['title', 'content'])
        );
    }

    public function paymentTypeNotAvailable()
    {
        return 'Töleg görnüşi elýeter däl';
    }
}
