I’m trying to set up Laravel Dusk to test my Laravel site as part of a larger Github Action CI/CD workflow. Following the documentation, I ran: The latter command created a tests/Browser directory and a tests/DuskTestCase.php file. The problem is that when I open up DuskTestCase.php Intelephense immediately complains: I also get a slightly different, but clearly related, error when
Tag: laravel
Compare two columns from two related tables using scopes in Laravel 9
I’m trying to create a scope that will compare two columns on two related tables. Based on these tables I would like to be able to get all instances of the ServiceCall model where the next_service_date is within the next 15 days, where the Customer model either has a null value for the last_contact_date or where it’s before the ServiceCall’s
Laravel relationship where clause is returning records outside relationship
I have a problem where i try to get all users from Site which is defined relationship in Site model and on where clause it returns users that belong to other Site Lets say that my $site_id = 2 and my $searchParam = ‘Tom’. It returns Tom that belongs to Site with site_id=1 but it also returns other Tom that
How can I modify my Controller so that the query is limited to the user id?
I have my Controller set up as such: Here I can pass everything from my DB into my view, but how can I filter these out such that only entries from a certain user_id is displayed? This is what my table looks like: https://imgur.com/AUZhA1L. I have attempted to use the {user} blade but am stuck. Answer Change this line: to
composer require s-ichikawa/laravel-sendgrid-driver failed in laravel 8.54
I downloaded the latest laravel framwork 8.54 and tried to install composer require s-ichikawa/laravel-sendgrid-driver, but it failed. is there any solution? Answer It looks like version 4 of s-ichikawa/laravel-sendgrid-driver requires version 9 of illuminate/mail, but Laravel 8.x uses version 8.x of illuminate/mail. Can you try to install version 3 of s-ichikawa/laravel-sendgrid-driver instead?
How to get file input name in Laravel?
I am using a jQuery form builder to create any kind of form input. The issue I had, in particular, is when I create multiple file inputs, the input name is generated randomly by default, the format is something like “file-0000-0”. I would like to get the input name but since it’s random, I can only think of one way
Laravel Join If Column Value Not Null
I try this method. I want to select discount if withCode value False. I try in where clause but in this method, if not false; I can’t access product. I want to select discount if withCode table FALSE. Else, I don’t want to select it Answer I solved with this codes;
Laravel Mail Connection could not be established Mailhog
I’ve installed Laravel Breeze and the ‘forgot password’ functionallity does not work. Login and registrer both work well, so I guess there is something wrong at sending the recovery email. This is the displayed error: at Symfony Component Mailer Exception TransportException. and here is an screenshot: error This is part of my .env file: The environment is: Ubuntu 21.10 Laravel 9.7.0 PHP 8.0.8 Tested
Laravel 9.x Contact form can’t connect to class
I’m trying to make a contact form. Main idea is user will send data, I will save the data to database, I will get the data from database, I will send the data as an email. I was following a tutorial -> https://www.positronx.io/laravel-contact-form-example-tutorial/ When I tried to reach classes on my controller it can not find it. Controller says this
Getting rid of numbers in a json response ( LARAVEL 9 )
i’m having some problems with my json response. When I make an api call from a user (id:1) it returns the response well, but if i change the user (f.e id:2) it returns it with some identifiers on it. Any idea? Response from id:1 Response from id:2 Thanks! EDIT 1 This is how I am getting the response: Answer Right