I am not sure if this is possible with Laravel eloquent, but I want to create an eloquent where the where condition would be based on the value of the current table column. Something like this for illustration purposes: column_a is part of the table column that I want to use. I could create 2 separate eloquent with their corresponding
Tag: laravel
IlluminateDatabaseQueryException could not find driver Laravel
I deploy a laravel project on an apache server on a Debian 10 machine. The database is an MySQL deployed on another debian 10 machine on the same network. I can go to the connection interface of the application but when I connect this error appears : I have already tried these commands : these commands work but do not
How to solve Laravel cant connect with mysql through docker
Im trying to deploy my laravel app using docker. Then I created docker-compose.yml file and Dockerfile like below. docker-compose.yml Dockerfile And when I try docker-compose up, all the containers run with a any error. And also when I run docker-compose ps, it shows like this, But, when laravel application, tries to connect with mysql, it doesnt happens. And even I
Error when trying to fill in form in Laravel 8
I am trying to create a form in Laravel, which has different fields that should be filled in. This is my code for the rules. They are stored in custom Request class: The store method is the following: This is my view: Now, when I try to fill in everything I get always the following error: The name must be
Do I really need to be Installing AWS Common Runtime for PHP to work with the AWS PHP SDK
I’m using the AWS SKP for PHP in a Laravel app. When I try to create a client (for EventBridge in my case) I am getting the following error: The error includes a link with information on installing it, however, I have kind of a hard time believing that Jeff Bazos has abused his developers so horribly they have decided
How to use a custom model’s method as property in Laravel 9?
In Laravel 9 I use Blade and Spatie´s Permisisons for authorisation. In addition I redirect admins to other Controllers / Layouts / Views than I redirect normal users to. With that approach I use the users table for both, admins and users. But users have a second table called clients with special normal user´s attributes. The Client model has a
Query relationship table with column that its data is an parsed array(1,2,3,4,5,6)
I have a string column in the table that have this kind of data // 1,2,3,4,5,6 comma separated data, supposedly this id has equivalent value to the another table. I have the solution that I can get the data of the mentioned ids but its a bit mess. This is the step that I have solution Get all data first
fill already available values into CRUD edit form in Laravel
Let’s say, I have a Laravel application with articles which can have several tags associated (i.e. an n:m relation). Creating those records is working pretty fine and I can also retrieve the selected tags array. All the necessary relations are available and working in Eloquent or in the models. Now, I would like to create an edit form in this
Running Laravel anonymous migrations in Orchestra Test Bench
When doing testing in Orchestra Test Bench I often need to interact with the DB. It used to be that in your TestCase you would run this: Since Laravel 9 (I believe), there are now anonymous migrations which as their name implies, don’t have class names. So the above method doesn’t work. Thankfully, this does allow migrations in a package
How do I update the incoming value if it’s a photo? [LARAVEL 9]
i have a question. database settings table : When adding a new setting I am sending data like this : and I’m querying this while editing: update method: my question is: if value part is photo how can i update it as photo… Answer You can use the UploadedFile’s store or storeAs to store the uploaded file and then store