<?php
/**
 * Created by PhpStorm.
 * User: zilongs
 * Date: 20-10-5
 * Time: 下午3:40
 */

namespace App\Http\Controllers\Api\V2;

use App\Models\Article;

class ArticleController extends AuthController
{
    public function articleList()
    {
        $data = Article::orderBy('id', 'desc')->paginate();

        return out($data);
    }

    public function articleDetail()
    {
        $req = request()->post();
        $this->validate(request(), [
            'article_id' => 'required|integer',
        ]);

        $data = Article::where('id', $req['article_id'])->first();

        return out($data);
    }
}
