laravel 8 restore code example
Example 1: laravel fillable
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'slug',
'body',
'image',
'published',
'comments_open'
];
Example 2: @foreac laravel
@if(count($posts) > 1)
@foreach($posts as $post)
<h2><a href="/posts/{{$post->id}}">{{$post->title}}</a></h2>
@endforeach
@else
</p>no posts found</p>
@endif