Skip to content
Advertisement

Tag: laravel

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

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

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

Advertisement