<?php

namespace App\Repositories;

use App\Models\PageText;

class PageTextRepository {
    public function getPageText(string $name) : string {
        $name = strtoupper($name);
        $pageText = PageText::where(['name' => $name])->first();
        if (null === $pageText) {
            PageText::create(['name' => $name, 'content' => $name]);


            return strtoupper($name);
        }
        return $pageText->content;
    }
}
