Hi @strmizo,
just stepped into the same trap -> see https://laracasts.com/discuss/channels/testing/phpunit-throws-errors-on-error-within-separate-blade-template. Did you find any explanation or solution to this?
Kind regards,
Chris
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm testing a form submit like this
$data = [
'start_date' => '12/07/2014',
'end_date' => '19/09/2015',
'name' => 'Tomorrow Land',
'venue' => '16th street',
'city' => 'LA',
'address' => '12th AV Morocco, LA',
'country_id' => \App\Country::where('name', $this->usa)->first()->id,
'state_id' => 4,
'latitude' => 18,
'longitude' => -23
]; `
` $this->actingAs($admin)
->visit($this->festivalUrl('create'))
->submitForm('Create', $data )
->see('The cover image field is required.');
But when I run the test this error occurs
exception 'ErrorException' with message 'Undefined variable: errors' in
I think the problem is from the view that has $errors variable which somehow is not filled.
Please or to participate in this conversation.