这是我的代码:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Article;
class ArticleController extends Controller {
public function show($id){
$article=Article::findOrfail($id);
return view('article', ['article' => $article]);
}
public function list() {
$articles=Article::all();
return view('articles', ['articles'=>$articles]);
}
}
这是日期形成代码,但我不知道将其粘贴到我的代码中:
date('d-m-Y',strtotime($ articles-> from_date));