Having trouble out of the gate...
Hi, new pro subscriber here...and admittedly a total newb to Laravel, though somewhat web-savvy. I'm a software engineer for decades, but mostly in the desktop/game world. So I can install Laravel using the official Docker instructions on the Laravel website. However, when trying to get going (on Windows) with Wave, the instructions are different, and doesn't include ".vendor/bin/sail". So I try copying the .vendor folder in its entirety over to my Wave project, but keep hitting brick walls there also. Is there a single video or document that walks someone through initial Wave setup from scratch on Windows? Sorry if this newb question has been answered a million times...
Thanks! -John
Your vendor
directory and files will be generated by Composer when you run composer install
to install Wave's dependencies.
Ah ok, I will try that. The problem is I won't have MySQL until I launch the docker, and step 1 is to create the database. Composer Install isn't until step 3.
Is it safe to say most don't use docker for Wave development? I'm new to Docker but it's cool, so that would be my preference. [Update: Composer Install doesn't work presumably because of lack of PHP or MySql running?]
Hi there,
It should be fine to use Laravel Sail with Wave just as you would for any existing Laravel application:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php80-composer:latest \
composer install --ignore-platform-reqs
The above will install the composer dependencies and then you will have Laravel Sail available as normal.
For more details you could take a look at the official documentation here:
Laravel Sail: Installing Composer Dependencies For Existing Applications
Hope that this helps.
I don't personally use Docker or Windows, but Laravel Sail's docker configuration should come with everything you need to run a Laravel app, e.g. php
, mysql
, composer
and even redis
.
You can read more about how to execute composer commands in the documentation for Laravel Sail.
Hi Bobby and thinkverse, I appreciate you both taking the time to reply even during the holiday...I'm getting closer, but I'm not there yet. Thanks for being patient with me. I would be willing to PayPal/Venmo someone for a 20-30 minute Zoom to help me sort this out. I think it's basically a chicken/egg problem...I can't set up my database before I install Sail because MySql is not running. And the instructions require that my database already be created when I run the composer install.
Here's my current order of operations...
- Git clone the Wave repo, changing the name to my project name
- Create the .Env file (realizing that I can't yet create a database, but gonna go ahead and set it anyway.)
- Run the docker command you provided...MySql fails.
- Edit the docker-compose.yml to remove MYSQL_USER
- Sail up ... all containers launch and run
- Using terminal, mysql -> create database appDatabaseName;
- kill/restart docker
- appName.test doesn't work, localhost gives a 500 error
(Forgot to mention I successfully ran migrate and db:seed also.)
Where have I gone off the rails? Again, I really appreciate the help. Once sorted, hopefully this is useful to other newbs down the road.
Hi there,
Regarding the MySQL problem, it should be ok to run composer install without having the MySQL container ready.
If the MySQL container is crashing, I could suggest changing the MySQL image to: image: "mysql"
. Let me know if this helps.
The appName.test
would only work with Laravel Valet or if you've added an entry in your Hosts file.
Regarding the 500 error, you could enable the debug mode, by setting the debug to true in your env file. This will show you the actual error rather than the generic 500 error.
I will try to find a windows laptop at home and try to replicate the whole process and document it.
Regarding the call, I might not have the time any time soon. At least not before the end of the holidays. @Thinkverse if you are up for the challenge feel free to do so.
Best,
Bobby
Hi Bobby, thanks for the reply. Late last night I did toss an echo in the exception handler and found the primary problem...MySql was not connecting. I opened a terminal window in Docker to the MySql service and discovered that it was being hosted on 'b05b009da412' not on 'localhost'. So trying to figure out how to deal with that. But I changed the .env file to reflect that and the site loaded...though, for some reason, the images were broken.
I've not used Docker before...so I don't know if I did something wrong or what. It's weird though that migrate and db:seed both managed to connect no problem...I verified in Docker that the tables have been initialized.
Thanks! -John
PS: Image links are not broken, just the default avatar icon...the path doesn't exist in the project folder.
Hi there John,
Happy to hear that you've got it up and running!
Regarding the images, there are two things that usually cause this problem:
- Make sure that the
APP_URL
matches exactly the URL that you are visiting in your browser - Make sure that the Storage link has been created:
./vendor/bin/sail artisan storage:link
Let me know how it goes!
Bobby
Sounds good! Happy holidays and good luck with your project 🙌