Laravel Spark prject links not working - laravel

How I create and run laravel spark project:
Create project using spark new myproject
set all required directory permissions
Since I am on live server I hit the public folder within the project.
The page display with two buttons 'Login' and 'Register'
When these buttons are clicked it jumps to the root directory, nothing works
Even if i hit the url like 'http://myip/myproject/register' the registration does not work.
What I am missing. please guide. I can't create virtual host.

You're using wrong web server configuration. You web server is pointed to a root directory where Laravel project lives.
You need to point it to a public directory which is inside Laravel project and restart web server.
After that use normal URLs without public in it.
Update
Correct nginx and Apache settings for Laravel 5

Related

Configuring Laravel project in DirectAdmin server

I'm a newbie to Laravel projects but I need to have one accessible over the internet so I tried using DirectAdmin but whenever I go to my domain I get an index (pictures attached).
I renamed the Laravel 'public' folder to 'public_html', is that correct? Here is my file structure.
Here is what I get when I go to my assigned domain which isn't my website at all.
The webpage should look something like this
I also found a laravel app using Softaculous linked here (https://panel.freehosting.com:2222/CMD_PLUGINS/softaculous/index.raw?act=software&soft=419). Am I required to use this app?
At first, you need to learn about the laravel directory structure. You don't need to change the laravel public folder to public_html. I am not sure how the DirectAdmin server works. but if you see a laravel directory instead of serving an application it's might be a path-related issue in your server. your domain should serve your application public folder.
I just found a tutorial for the DirectAdmin server with laravel. that might help.

Laravel, Using a cPanel shared hosting if possible?

I have a shared hosting with bluehost.com... can I just put my project on that.. like upload public files to public_html and others to root directory and backup MySQL DB and upload it to my shared hosting then edit my .env file... will this actually work with Laravel?
I searched most online resources and it requires ssh access to deploy, but the way I explained should not require that right?
I mean this way you don't have to go throw terminal access right?
I used to do that with WordPress when I want to set everything locally then upload it and edit URLs from the dashboard and stuff...
Yes it would work.
But you have to ensure one thing that, in your cpanel your domain point to the /public folder of laravel project.
Normally cPanel points the http requests to public_html folder, but laravel start from its public folder. You can achieve this by two way.
By pointing your server to straight to public folder
Copying the index.php to the public_html, in that case you have to edit index.php to run the laravel project properly. And I don't recommend this step. Step 1 is lot more easier.

How to host Laravel project on Raspberry Pi

I have scoured the depths of the internet for this solution and I come up empty handed. I have installed apache server on my pi and when I access the IP address from another computer, it pulls up the correct index.html page. So the server is working fine. My problem is that I can't get my Laravel app to work. When I deploy my laravel apps to other hosting sites, I put everything except the "public" folder into a separate folder in the file tree, and edit the index.php file in the public folder to match the new file structure of pointing to the autoload.php and bootstrap files. None of that is working for me in the apache server on the Pi. Can someone tell me how to do this or where there is legitimate documentation on how to do it. Please don't point me to any google articles that come up in the first 3 pages because i've read and tried them all.
The only thing that happens right now is that when i go to "IPaddress/project_folder" in the URL, it just brings up the file tree in the browser as opposed to pointing to my "/" route within the laravel project.

Laravel on a directory, links e.g. login link does not work

I have uploaded my Laravel app unto a directory under the public folder on my domain,
html_docs/public/store
where 'store' is the folder of my Laravel App. My main domain pointed at 'html_docs/public', please check my laravel app here "https://www.dinhi.org/store/". As you can see, when you click the "sell with us" or "login" on the top header, it returns
Not Found
The requested URL /store/dashboard/login was not found on this server.
I have set up to in my '.env' and in my 'config/app.php' the right url like "https://www.dinhi.org/store/" but still not working, any ideas, help please?
PS: I'm on Laravel 5.3 and I'm using Hesto Multi Auth. In my local, this issue does not exist like everything is good and working.
Laravel is not meant to be installed completely into the document root of your server. Actually, every folder of your laravel application except the public folder should be inaccessible from the web.
Your exposing yourself to a security risk here, since everybody could access every file of your app, including potential .env files with database credentials and the likes.
Cheers
Christoph

config sentinel to work with "public/index.php" in laravel

I have install Laravel in my VPS, and it's working with the "public/index.php" in the url. I had tried lot more to remove this from url but all are failed, and I have to work with this. Currently I am working on the Sentinel authorization package. It's installed successfully but after login or when i click on the sentinal logo I always get redirected to the "http://myipaddress/tmb/" which is incorrect, so where I can set the home link so that it goes to the "http://myipaddress/tmb/public/index.php/". My laravel version is 5.1.20
The default config for the target URLs is the 'home' route. So you have to setup this route in your routes.php properly.
You can override the default routes in the config/sentinel.php file.
But anyway, it's very dangerous that anyone can access your whole application code directory. You should either forbid access to all resources which are not in /public directory or (much better) configure/ask your VPS to set the document root to your public directory!

Resources