artesaos / seotools

SEO Tools for Laravel
MIT License
3.04k stars 503 forks source link

Non-static method Artesaos\SEOTools\SEOMeta::setTitle() cannot be called statically #310

Closed Rayiumir closed 1 year ago

Rayiumir commented 1 year ago

Hi... I installed the package but it gives an error.

public function index()
    {
        SEOMeta::setTitle('Home');
        SEOMeta::setDescription('This is my page description');

        if(cache()->has('articles')) {
            $articles = cache('articles');
        } else {
            $articles = Article::latest()->take(6)->get();
            cache(['articles' => $articles] , Carbon::now()->addMinutes(10));
        }

        if(cache()->has('courses')) {
            $courses = cache('courses');
        } else {
            $courses = Course::latest()->take(8)->get();
            cache(['courses' => $courses] , Carbon::now()->addMinutes(10));
        }
        return view('home.index', compact('articles', 'courses'));
    }
Rayiumir commented 1 year ago

Solved