Im making a simple real-time chat system in laravel and i want it to deploy on heroku. But when i do heroku run php artisan websockets:serve it gets me some error. Is this the correct way to do it?
Here is the console
Its currently not possible as stated here:
https://help.heroku.com/8R7OO0ZV/can-i-run-a-websockets-server-using-php-on-heroku
Related
I developed a desktop application in react and electronjs. And built an API with laravel, eveything works perfectly. The challenge I have is, how I can deploy and run my electron app locally without having to manually setup the laravel API.
I am looking for a way to have all of this setup and installed once. I checked out a couple of options and one of such is php-server but that wasn't still going to cut it.
Shell Scripting
I have thought about executing a shell script to create the server instance pull my laravel application from github, set it all up on docker.
The challenge is, if any of my users run docker ps they would see all the processes running on my docker instance.
A possible solution would be isolating docker so it's not accessible globally but only within the application.
I don't know how to achieve this.
If this is achievable please drop some guide on how to achieve that or maybe suggest a better way to handle my current situation.
Why i'm getting error while running php artisan preset react in my console. I'm working in my online enrollment system and i wanna use laravel and react. But i got stuck in this problem and i dont know about this error.
I have created a react-laravel project using laravel-mix. Right now I am run project using
npm run watch
php artisan serve
So by this, I access project by : http://localhost:8000
I have also worked in laravel. In laravel, if we want to access project without php artisan serve then we can access using : http://localhost/project_name/public.
Now my question is, how can I access/execute react-laravel project without php artisan serve? Is there any kind of way to access/execute project without port? Because I want to set up react-laravel on live server and I don't want to continue open terminal on server after code uploading.
I will really appreciate your feedbacks.
There are a multitude of ways to set up a laravel project. and it has nothing to do with the frontend suite you use whether its React or Vue, I will give you 2 options here to run a laravel application.
1. vagrant/homestead
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
Doc Link
2. XAMPP/WAMP/ or any LAMP stack
XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.
Link
Personally I prefer Laravel Homestead since it contains everything out of the box for laravel Development. like PHP, Nginx, MariaDB, Node, etc...
This is the first time I've used a PHP framework.
I've been following the Laravel documentation to install Composer and Laravel, and everything seems to have gone smoothly.
But now I've finished the installation/configure instructions, and I have created a project, I can't see any instructions on how to serve my application so it's viewable via a browser?
I have used Ruby on Rails before, which came with an easy way to get an instance of the application running via a built-in web server.
Is there something similar with Laravel, or do I need to somehow configure my standard Apache instance to serve the application?
I'm guessing there is something I've overlooked or misunderstood in the documentation.
yes, you can do it by using following in your terminal.
open your terminal, and navigate to directory where you have your project abc
and fire following command
php artisan serve
Now you can access it in browser by going to http://localhost:8000
hope you get it
I just want to add to the answer of Mubin Khalid . You can choose your own port number like
php artisan serve --port=8080
This is helpful when running two or more project.
You can also serve with you ip address
php artisan serve --host=ip_of_computer_running_laravel --port=8080
works to access server with in same network.
if you are accessing from same laptop you can just browse to ip_of_computer_running_laravel:8080 but if you are browsing from other computer in the network ip_of_computer_running_laravel:8080
I'm fairly new on Laravel's technology regarding real-time application. I'm trying to make a notification system and from what I Google, using some kind of socket server is the best way.
So I'm trying to use this: https://github.com/BrainBoxLabs/brain-socket
But I have no idea how to run it on live server later, since I don't own the server itself I can't run commands like: php artisan brainsocket:start in terminal, so I need to figure out how to run that command by using php code?
Or if my method is wrong, how to use that brain-socket in live server?
You can do this with
Artisan::call('brainsocket:start', $args);
where $args is an array of arguments.
See the Laravel docs.