infojune/app/Http/Controllers/ContentController.php

28 lines
525 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Content;
use App\Models\Category;
use Illuminate\Http\Request;
class ContentController extends Controller
{
public function index($path){
$category = Category::where('path', $path)->firstOrFail();
//dd($category);
return view('choicebox')->with('category', $category);
}
public function show($path){
$content = Content::where('path', $path)->first();
return view('softbox')->with('content', $content);
}
}