How to properly migrate Laravel project? - laravel

I have my laravel project and copied to another folder. I have changed the name of the app and my AJAX requests stopped working. GET works fine but POST,PUT methods either return '405 Method not allowed' or '500 Internal error'.
I am not acquainted with Laravel so could you please tell me what I possibly didn't do? Is there some REST config file where I configure routes?

Related

Laravel Nova Tag field results in 404 on production

I seriously cannot wrap my head around this.
Locally the tag field of Laravel Nova 4.0 works like a charm (https://nova.laravel.com/docs/4.0/resources/fields.html#tag-field). On production it results in a 404 page on the resource-detail page.
Everything seems to be the same. Same laravel nova version (4.20.2), same data, same other packages.
I've narrowed it down to this call being sent on production:
Request URL: https://api.foodinfluencersunited.nl/nova-api/tags/23a1f0b3-eaac-45c3-b6da-7c1acda08f9d/preview
Which is not sent locally. This call should either not be sent on production (since the tagField has "withPreview" off, or at least it should be sent to:
Request URL: https://api.foodinfluencersunited.nl/nova-api/roles/23a1f0b3-eaac-45c3-b6da-7c1acda08f9d/preview
Since the uuid which is sent is the UUID of a Role-resource.
Does anyone have any idea where I should search for the solution?
I'm trying to at least get the error locally as well.
Imported the production data to local server and made sure that everything else is similar.
It appeared I had out-of-date js on one of my production servers. php artisan nova:publish did not run automatically on one of them. That solved my issue.

intervention-image with laravel 5.2 on ubuntu-server breaks the other calls

I am using laravel 5.2 to write services for a mobile app. all the calls are working fine. My project is deployed in ubuntu server.
Now I want to resize the uploaded images inorder to maintain same performance. I thought of trying intervention-image.
In local machine it worked fine. I installed intervention-image and set the provider and alias name, I included the alias name to controller. Once I do that and update the server, all the other calls are getting effected. I am getting 505 error.
It's the intervension-image which is causing this problem, I checked with previous upload and I am getting all the calls. Any suggestions?
I suggest you create a dev environment like your production , use vagrant . About error 505 check you error log file to have more detail about the bug

Laravel 4 localhost status 500

I pushed (bitbucket) a laravel 4 project from my imac and pulled it with another mac. What I get is a status 500 message if i try to visit /public.
I am using MAMP.
The strange thing is that every other laravel project is working fine. One project is even a copy of the project that doesn't work.
Any idea whats wrong?
Point Apache to a public directory instead of root one and use URLs without public in it.
Restart web server after that to make it work.

Strange error showing up in laravel logs

I have a site built with Laravel 5.2, and everything is running smoothly, but I keep seeing this in my logs:
'ErrorException' with message 'Route [baldeaglecontracting.home] not
defined
The way I have my routes configure, this means someone is trying to hit a baldeaglecontracting subdomain on my site like baldeaglecontracting.mydomain.com
What I can't figure out is, why would someone be trying to hit this same subdomian on my site over and over again?

500 error when integrating multiple apps in one code base

I'm trying to set up an MVC application that will service several facebook applications for various clients. With help from Prabir's blog post I was able to set this up with v5.2.1 and it is working well, with one exception.
At first, I had only set up two "clients", one called DemoStore and the first client, ClientA. The application determines what client content and facebook settings to use based on the url. example canvasUrl: http://my_domain.com/client_name/
This works for ClientA, but for some reason when I try any DemoStore routes I get a 500 error. The error page points to an issue with the web.config.
Config Error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'facebookredirect.axd'
I am able to add additional clients with no problem, and changing DemoStore to something like "demo" while using the same facebook application settings works fine also.
Working calls:
http:// localhost:2888/ClientA/
http:// localhost:2888/ClientB/
http:// localhost:2888/Demo/
Failing call:
http:// localhost:2888/DemoStore/
I was thinking this might be an MVC issue, but the Config Error points to the facebookredirect handler. Why would the SDK try to add this value to the config during runtime, and only for this specific client?
Any insight would be greatly appreciated.
I managed to figure out what went wrong here. Silly mistake..
After I had set up the application routes to require the client_name I changed the Project Url in the project properties to point to demostore by default. When I hit ctrl+S a dialog popped up that I promptly entered through without reading.
When I changed the Project Url, IIS Express created a new virtual directory for the project. This was the source of my problem. Why? I'm not sure, but once I removed the second site from my applicationhost.config I was able to access the DemoStore routes.
Moral of the story: read the VS dialog messages!

Resources