Skip to content

Tag: laravel-8

Feature test for HTTP RESTful API on Laravel 8

I’m trying to write a feature test in RESTful API that I have been created in laravel 8. I have ChatController that gets user chats by getUserChats method: that called by this route: this is my feature test on this route: the test runs successfully by this green output OK (1 test, 3 assertions) but I do…

Laravel 8: Argument 2 passed must be an instance of

I’m working with Laravel 8 to develop an Online Forum. And I made this form for updating an answer of a user: And here is the route for this: And this is also the Method of QuestionController: But now the problem is, whenever I submit the form in order to update answer, I get this as error: Argument 2 p…

Using stacks in Laravel 8

I’m building a site using Laravel 8 and Jetstream. Jetstream is opinionated about the javascript / css framework, which is great, but I’m needing to add an external javascript library to one of my components, and I don’t see anywhere to add them in the default app layout. So I added a stack …

How to combine two counts using Laravel

Using Laravel 8 for a restful API. A table in the database has following fields report_date , supervisor_id and supervisor_note I want to retrieve a result that counts the number of reports on any given day date and also counts all of the null values in supervisor_notes field. I am using the following Laravel…

How to use UUID instead of a slug for ticket

I am currently navigating to a ticket using the slug set by the title example blah-blah-blah and want to use uuid instead of 336c64de-5dcb-34bc-9511-a48242b9zzzb. What is the best approach to take for Laravel 8? I am using Laravel Jetstream with Livewire stack. Current model code Ticket Migration Answer add u…