Slide 9
Slide 9 text
ιʔείʔυྫ
9
class Article extends Model
{
public function getBodyAttribute($value)
{
$parser = new GithubMarkdown();
$this->attributes[‘body’] =
$parser->parse($value);
}
}
class ArticleController extends Controller
{
public function index(Request $req, $id)
{
$article = Article::find($id);
return view(‘article’, [
‘article’ => $article
]);
}
}
{{ $article->title }}
{!! $article->body !!}