I’m having issues with a new Laravel app behind a load balancer. I would like to have Laravel do the Auth middleware 302 redirects to relative path like /login instead of the http://myappdomain.com/login is actually doing. I only see 301 redirects in the default .htaccess Laravel ships which makes me be…
What’s the difference between xdebug.ini and php.ini
Recently I installed lamp and php-xdebug on an ubuntu 16.04 box. I noticed that now I have the following files /etc/php/7.0/apache2/conf.d/20-xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini /etc/…
PHP binding method to another class
Can i bind method of class Foo to class Bar? And why the code below throws a warning “Cannot bind method Foo::say() to object of class Bar”? With function instead of method code works fine. P.S. I know about extending) it is not practical question, just want to know is it real to bind non-static m…
How to run 2 or more input files in the same form with PHP
I would like to know how to run 2 or more input files in the same form, I have to upload some documents by using php, I made separate forms and they work, but I need to all together however I dont know how. I need to put only two forms as example actually I need to put 3 but
Upgrade PHP on AWS Linux
I have an AWS server running a website with NGINX and PHP. I originally installed these using the following: sudo yum install -y nginx php-fpm The version of PHP that is installed is 5.3.29 which but I need at least 5.4 to run a payments plug-in. All the info online indicates a PHP upgrade actually involves a…
Insert null or something if value of csv is null
I have a problem uploading a csv to mysql. I have the following csv. I need to upload the marked fields the max fields the csv can contain are 48 but some csv contain only 36 or less. I have a form which if csv contains 48 cells uploads succesfully to mysql but if the csv is less than 48
How to get all tags from WordPress page/post as a list in shortcode?
At the end of each page and every post, I would like to output the tags as a list in a shortcode. Unfortunately, I do not know much about PHP, but someone who can understand will definitely be able to correct my mistake using the code below. Thank you in advance! Answer The method needs to return a string to
How can I redirect to the same page with $_GET parameters in URL
i’ve got a question about redirecting. I put some parameters in my URL so I can use $_GET to get them out en them put them in a variable. Now, when I fill in my form wrong i get redirected but all the parameters are missing and they don’t are in the variables anymore. Is there a way you can
Custom findOrFail for the API routes
I think this should be implemented by default since I’m working in routes/api.php. I want to give a 404 error JSON response in case that we don’t find any rows for the given id argument on findOrFail(…
How to add dynamic slider in laravel
I’m using laravel and I want use slider in my index page, here is my slider code: