anjama
Creating table filter in a trait
Laravel macros are new to me. While trying to find documentation on them, I eventually came across Dan Harrin's recent laracasts series, and it turns out one of his videos creates a custom filter and turns it into a reusable class like I was thinking about https://laracasts.com/series/build-advanced-components-for-filament/episodes/11. So I'm going to go with that approach, but now that I know about Laravel macros, I'll definitely be spending some time learning them.
Edit: while creating the class, I realized I forgot to import my SoftDeleteScope class into the trait. I didn't realize that would fail silently.
5 replies
Laravel Excel not running in action
So it turns out you were on the right track. I tried giving a bad file name intentionally, and it didn't change the behavior (no exception), which made me realize that the app must be looking for the data in a different place than when I run it from the command line in tinker or a seeder. Sure enough, it's because my test data is in it's own project folder, and moving it to the storage folder fixed it.
22 replies
Laravel Excel not running in action
To troubleshoot, the way I have it right now, I'm manually specifying a known existing test file and ignoring whatever file the user uploads. So the temporary uploaded file doesn't matter at the moment. Here's a simplified version to illustrate without the file upload part:
So now I have a button that should import that specific data into the database and then create a notification. The data is already in the database, so it should produce an exception. When I press the button, the notification occurs, but the exception doesn't. I can copy/paste the import line into tinker and it does produce the expected exception.
22 replies