// Controller
$posts = Post::all();
return view('posts', ['posts' => $posts])
<?php /** @var \App\Models\Post $post */ ?>
@foreeach ($posts as $post)
<div>
{{ $post->title }}
<div>
@endforeach
$posts = Post::all()->toArray();
public function __construct(User $firstname)
{
$this->user=$firstname;
}
public $firstname;
public function __construct(string $firstname)
{
$this->firstname=$firstname;
}
Mail::to('temoha1386@gmail.com')
->send(new mailsendform($any_data));
return $this->view()->with('variable', 'value');
'invaite_token'
- нет такого правила.$token = Invite::where('invite_token', $value)->first();
if (!$token) {
$fail('Приглашение не существует');
}
protected function create(array $data)
{
$this->validator($data)->validate();
return User::create([