coinwind/app/Http/Controllers/ArticlesController.php

28 lines
562 B
PHP

<?php
namespace App\Http\Controllers;
use App\Articles;
use Illuminate\Http\Request;
class ArticlesController extends BaseController
{
public function index($type)
{
$lang = session("language");
if (!$lang) {
$lang = 'en';
}
$list = Articles::where(array("type" => $type))->where(array("lang" => $lang))->get();
return view('articles', ['data' => $list]);
}
public function detail($id)
{
$list = Articles::find($id);
return view('detail', ['data' => $list]);
}
}