Sergiu17's avatar

Sergiu17 liked a comment+100 XP

1mo ago

@sandraalmassri OK? Do that, then?

Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

1mo ago

I don't think you want to test the middleware itself, you need to make sure some specific routes has that middleware.

collect(Route::getRoutes())
            ->filter(fn ($route) => str_contains($route->uri(), 'api'))
            ->each(fn($route) => $this->assertContains('throttle:60,1', $route->gatherMiddleware()));

modify the filter according to your needs

Sergiu17's avatar

Sergiu17 was awarded Best Answer+1000 XP

2mos ago

Since not all the records are loaded - there's no way to know which records to select, you'd need to send a key in order to remove all, for example, selected_all=true

Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

2mos ago

Since not all the records are loaded - there's no way to know which records to select, you'd need to send a key in order to remove all, for example, selected_all=true

Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

2mos ago

Make sure XSRF-TOKEN is stored in your browser ( Dev tools -> Storage -> Cookies ), then make sure axios is configured properly

axios.defaults.withCredentials = true
Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

2mos ago

Hello, check Laravel Cloud https://cloud.laravel.com/

Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

2mos ago

Try to add a pause just to see if it's because of the logic on the server

visit(route('referrals.create'))
        ->type('#company', $company->name)
		->pause(1000) // <---------- this
        ->select('#type_id', '1')
        ->radio('[name="code_or_url_radio"]', 'code')
        ->fill('#code_or_url', '122234')
        ->fill('#referrals_commission', '10')	
        ->press('#save')
Sergiu17's avatar

Sergiu17 liked a comment+100 XP

4mos ago

Isn't route model binding performed in middleware?

Sergiu17's avatar

Sergiu17 liked a comment+100 XP

4mos ago

Thank you

Sergiu17's avatar

Sergiu17 wrote a reply+100 XP

4mos ago

$new->created_at is null, and you are trying to call a method on null which results in an error. Check why created_at is null in the first place, as a solution use nullsafe opeartor

{{ $new->created_at?->diffForHumans() ?? 'Unknown date' }}