You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xshop/app/Http/Controllers/ClientController.php

33 lines
772 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Post;
use Illuminate\Http\Request;
use Spatie\Tags\Tag;
class ClientController extends Controller
{
//
public function welcome(){
$area = 'index';
$title = config('app.name');
$subtitle = getSetting('subtitle');
return view('client.welcome',compact('area','title','subtitle'));
}
public function post(Post $post){
$area = 'post';
$title = $post->title;
$subtitle = $post->subtitle;
$post->increment('view');
return view('client.post',compact('area','post','title','subtitle'));
}
public function tag($slug){
$tag = Tag::where('slug->'.config('app.locale'),'like',$slug)->first();
return $tag;
}
}