Laravel Herd has a nice `share` feature built in, but it doesn't handle Vite very well. Watch me fix that issue! • Laravel Herd's share: herd.laravel.c... • Ngrok: ngrok.io/
Maybe you should print the public URL in your terminal to make it easier to browse or share 😊. Great tip and excellent inspiration for my current project 🙂. I had the same problem with Laravel Herd; everything was working except the Vite server.
Any time I hear someone say "beware of infinite loops", I always respond "unless you're Aaron Francis" - Dude this is sick! glad you got it working I feel like through some vite conf related to `server.host` you could also set the public domain, but the idea of not even touching the vite config file directly is also pretty dope
Love this contents and how much important is writing clean and readable code. This is also one case when moving logic to a job does not make really sense. So great job!!!
Wow I learned soooo much. And so useful right away! Thank you! Would Laravel Context maybe be a replacement for the sharefile solution? This might be a package idea - are thinking of making it into one?
Yeah! If the Herd and/or Laravel team doesn't fix it I totally will
Місяць тому+1
@@aarondfrancis I would suggest you doing it anyway, because the 'Expose' herd uses always gives you a different URL in the free version, which is sad when you might need a static one, and in addition it only works for an hour then you need a restart.
Hey! I used vite in past few months in Windows, I also encountered that issue. I thought that was okay and normal not to render frontend in my phone after "npm run dev" because there was no nodejs installed in my phone, so i "npm run build" it and it works (atleast i will saw the changes) in the phone but only working if "npm run dev" server is stop. Does Ngrok supported in windows? I will try it, if it is.
I noticed that your auto complete seems to be scoped to the file contents and isn't suggesting everything under the moon. Do you have any special configuration?
@@aarondfrancis I wish they had a settings diff 🤣 I noticed some scope configs for search and the file structure, but your suggestions look so clean. I'll just have to try it out!
@@aarondfrancis I mean @ 11:15 the while(true) loop. as I know php uses set_time_limit() / max_execution_time configuration to limits the maximum execution time, and setting that to 0 (no limit) may affect the server load and it may be better to run such script in the background. anyway, I replayed that part again and I think you mentioned that the process facade will put it in the background. Thanks once again.
watch this many time but when i tried it out, i add request_header - host: local.test ngrok auto redirect to local.test with status 301 Moved Permanently can you help pls :(
@@aarondfrancis thank you for reply. but after do that ngrok stuff like on this video at 03:52 , then access ngrok link, browser automatically redirect to local.test again.
@@amalebu Right, I'm trying to help you debug. Start with the easy steps. 1) does it work without ngrok? 2) does any other site work with ngrok? 3) can you spin up a brand new app to see if it works there? maybe it's your app? I'd go down that road. good luck!
Since you have to configure apache/nginx if you wanna host bare-metal or via VPS, learning how to config access via your own network is a really good lesson. all these 3rd party ways just make you less capable of handling stuff on your own.
@aarondfrancis I have no intention of causing any harm or conflict. I simply wanted to share my perspective on using third-party "do it for you" tools in software development. I understand that for solo developers or small teams handling multiple aspects of a project, taking shortcuts may seem appealing. However, I believe that this approach can hinder your learning and understanding of the actual deployment process. Once a project is in production, it cannot rely solely on local development environments and temporary solutions like ngrok. By avoiding shortcuts, you can acquire and retain the skills necessary to properly maintain your project in the long run. Of course, if you are solely responsible for the Laravel development and others handle other aspects, then using these tools can be beneficial. I apologize if my previous comment came across as snarky or disrespectful. That was not my intention.
Sure, no problem. This is just a way to share a local only project. Ngrok is the easiest way to expose my local machine to the public internet. It's completely separate from the deployment process or even anything related to production. Ngrok (or their friends) is the best tool for the job. I don't even know how I'd route a domain to my local machine without them.
@aarondfrancis To launch an Apache or Nginx server and point a domain to it, install the web server on your machine, configure the server settings, ensure the server is running, then update your domain's DNS A-record to point to your server's IP address. I'd say that it's easier than what this video takes you through if the server configuration is omitted 😅 I set up my own dev server for free on oracle using this method. There is no need to use my local machine anymore when I dev, which feels so good 😎
But I want to use my local machine. That's what you're missing. I know how to use a server. I know how to deploy! I know how to set up nginx. I want to serve it from my Macbook so I can debug things locally with my business partner who lives far away.
Maybe you should print the public URL in your terminal to make it easier to browse or share 😊. Great tip and excellent inspiration for my current project 🙂. I had the same problem with Laravel Herd; everything was working except the Vite server.
I dont even use Laravel, but the way you make the video was awesome!
you can also use cloudlflare tunnels and you can even specify a subdomain so i doesnt rotate as ngrok does. nice work 😊
cloudflared tunnel create
I'm using it to expose my RPi server to the web. Running 2-3 apps
Any time I hear someone say "beware of infinite loops", I always respond "unless you're Aaron Francis" - Dude this is sick! glad you got it working
I feel like through some vite conf related to `server.host` you could also set the public domain, but the idea of not even touching the vite config file directly is also pretty dope
Man ! I learned a lot with this video! And I’m a 10+ years experience developer. 😂
gotta love ryan reynolds doing laravel 😃
my whole life I was pronounce ngrok wrong. I pronounce it as NG ROK 😭
wait samee...
Spot the angular dev
🤏
Love this contents and how much important is writing clean and readable code. This is also one case when moving logic to a job does not make really sense. So great job!!!
good ol ngrok, good for paypal development notifications also
Who else was waiting for him to add the ngrok URL to the output? 😆
Wow I learned soooo much. And so useful right away! Thank you! Would Laravel Context maybe be a replacement for the sharefile solution? This might be a package idea - are thinking of making it into one?
Great vid as always man! Would love to see all of this running from a single command
Then you can have my kingdom
You are awesome Aaron, Thanks.
Thanks, learnt signalable commands!
Thanks Aaron, great content 🎉
I think you can also change the Vite server url using a env variable, no need to manually update the public/hot file
But then I'd have to change the vite config anytime I want to share
You could have your command start vite as well and supply the ENV var that way
Hey Aaron,
I really like the camera setup you have. What camera and lights do you use?
It's a Canon R6 running through an Elgato camlink!
Did you manage to get WebSockets proxied as well to support auto-reloading?
Yup!
@@aarondfrancis Hmm, I must have missed something then. I'm getting `WebSocket connection to 'wss://site.test/' failed` errors.
Found it! Turn off HTTPS in Herd :)
Can you share the code? This could be a great plugin 😀 Or atleast something i include in my composer.json dev in every project.
Yes! Let me work on it
Why not using expose?
Great work and great watch!
Will you publish the code somewhere? Maybe even make a package?
Yeah! If the Herd and/or Laravel team doesn't fix it I totally will
@@aarondfrancis I would suggest you doing it anyway, because the 'Expose' herd uses always gives you a different URL in the free version, which is sad when you might need a static one, and in addition it only works for an hour then you need a restart.
Hey! I used vite in past few months in Windows, I also encountered that issue. I thought that was okay and normal not to render frontend in my phone after "npm run dev" because there was no nodejs installed in my phone, so i "npm run build" it and it works (atleast i will saw the changes) in the phone but only working if "npm run dev" server is stop. Does Ngrok supported in windows? I will try it, if it is.
why don't using docker sail ?
I don't need it. Herd does everything I need.
I noticed that your auto complete seems to be scoped to the file contents and isn't suggesting everything under the moon.
Do you have any special configuration?
I... have no clue 🙈
@@aarondfrancis I wish they had a settings diff 🤣
I noticed some scope configs for search and the file structure, but your suggestions look so clean.
I'll just have to try it out!
This man runs ublock origin AND adblock plus. Impenetrable :'D
Try to show me an ad, I dare you!
Interesting.
Now how does Laravel handle infinite loops?
Thanks Aaron!
Sorry I don't understand the question
@@aarondfrancis I mean @ 11:15 the while(true) loop.
as I know php uses set_time_limit() / max_execution_time configuration to limits the maximum execution time, and setting that to 0 (no limit) may affect the server load and it may be better to run such script in the background.
anyway, I replayed that part again and I think you mentioned that the process facade will put it in the background.
Thanks once again.
Ah this is a CLI, so there should be no such limit
@@aarondfrancis I see 👍
Editing glitch at 1:50... hehe
haha oh well
iOS Simulator should also help because you can hit local hosts.
watch this many time but when i tried it out,
i add request_header - host: local.test
ngrok auto redirect to local.test
with status 301 Moved Permanently
can you help pls :(
Does it load in the browser when you just hit local.test? Before you do any ngrok stuff?
@@aarondfrancis thank you for reply. but after do that ngrok stuff like on this video at 03:52 , then access ngrok link, browser automatically redirect to local.test again.
@@amalebu Right, I'm trying to help you debug. Start with the easy steps.
1) does it work without ngrok?
2) does any other site work with ngrok?
3) can you spin up a brand new app to see if it works there? maybe it's your app?
I'd go down that road. good luck!
@aarondfrancis thank you very much for always replying and give solutions.. cant wait for more videos from you. Big thanks
or just use vscode port forwarding ??
Perhaps you didn't notice that I do not use VS Code
@@aarondfrancis 😓
Any reason for using ngrok over built-in expose?
The config file so I can route vite and Laravel
master class
why not just use your lan?
Cause I also need to share with my coworker who lives in a different state!
❤
i loveyou Aaron
🫶 thank you
Since you have to configure apache/nginx if you wanna host bare-metal or via VPS, learning how to config access via your own network is a really good lesson.
all these 3rd party ways just make you less capable of handling stuff on your own.
I got exactly the outcome I was looking for... what do you mean I'm not capable of doing it on my own? What do you want from me!
@aarondfrancis I have no intention of causing any harm or conflict. I simply wanted to share my perspective on using third-party "do it for you" tools in software development.
I understand that for solo developers or small teams handling multiple aspects of a project, taking shortcuts may seem appealing. However, I believe that this approach can hinder your learning and understanding of the actual deployment process. Once a project is in production, it cannot rely solely on local development environments and temporary solutions like ngrok.
By avoiding shortcuts, you can acquire and retain the skills necessary to properly maintain your project in the long run. Of course, if you are solely responsible for the Laravel development and others handle other aspects, then using these tools can be beneficial.
I apologize if my previous comment came across as snarky or disrespectful. That was not my intention.
Sure, no problem. This is just a way to share a local only project. Ngrok is the easiest way to expose my local machine to the public internet. It's completely separate from the deployment process or even anything related to production. Ngrok (or their friends) is the best tool for the job. I don't even know how I'd route a domain to my local machine without them.
@aarondfrancis To launch an Apache or Nginx server and point a domain to it, install the web server on your machine, configure the server settings, ensure the server is running, then update your domain's DNS A-record to point to your server's IP address. I'd say that it's easier than what this video takes you through if the server configuration is omitted 😅
I set up my own dev server for free on oracle using this method. There is no need to use my local machine anymore when I dev, which feels so good 😎
But I want to use my local machine. That's what you're missing. I know how to use a server. I know how to deploy! I know how to set up nginx. I want to serve it from my Macbook so I can debug things locally with my business partner who lives far away.
Great video Aaron. learned many new things