Hello everyone, This is my first time posting ! I am running into a problem when applying laravel 8 migrations on my new web server. While trying to deploy my projet I’m unable to apply migrations and I’m not sure why. Below images of the error and my migration, i’m using the php artisan mig…
Tag: php
How to loop through div per div
Horrible title aside, I currently have a dynamic form that has tasks, and per tasks, statuses. The amount of tasks and status can vary. What I’m trying to do is submit the task name, status name, and colors tied to that status. I’m submitting the form via js and the only different thing is creatin…
Add sale badge to product thumbnail on single product page and shop archive pages in WooCommerce
I use the following code to add a small badge topleft of every product with -%off. On my product page and it works. However when i try to do it on category page to all product listings with the following code: It does not work, there doesn’t seem to be any adjustment. Can I get some guidance into it? An…
Insert into MySQL table if no row added within 5 minutes
I have a table which contains a column consisting of timestamps. I want to check if there is a new row within 5 minutes period of time. If not, then insert a new row or update the last row status column. I tried something like this: or insert into … but no success so far. I’m using PHP in WordPres…
api versioning page not found
I’m trying to create my 1st API on Laravel 8, and want to create versioning that would look like this My user controller looks like this in my config/app.php i have this ‘api_latest’ => ‘1’, in my middleware (appHttpMiddlewareAPIVersion.php) in my kernal (app/http/kernel.php) …
Sending an otp to the input mobile number and verifying it, in my html page
I want my html page to send an OTP to the mobile number given in the input text, when I press Send OTP button. And upon giving the OTP as input I want my webpage to verify whether it’s the same OTP that was sent to the mobile. How do I achieve this? This is my html code: Answer There’s
Laravel update all users age by x
I want to update all users in my database with an age value which I get from my request. How do I manage this? I somehow need the current value in the db and multiple it. Answer Let’s assume that the name of the field in your $request is multiple, you can iterate over your customer records and update ea…
How to toggle a boolean value with livewire and checkboxes
I am trying to create this filter thing with check boxes. I am trying to toggle the state of the check boxes to be true or false When I do this approach, I am not sure how to make the inverse work, so if it is unchecked It would be false. Is there a way to add something to this,
Should you leave the Laravel debug bar on a published site?
New to using Laravel and php. I’m working on a project, and there’s a debug bar on the bottom of a published web app. Is this standard? Or should I tell my manager to remove it? Is there any security issues? .env is currently: Answer Yes, it is a security concern. The debug bar should only be avai…
Doctrine 2 – MySql : multiples ‘BASE TABLE’ queries added to every views
Do you know why every views of my Symfony 4.4.25 website using Doctrine ORM 2.9.3 add between 3 and 10 queries like this: The database is MySQL version 5.7 Answer I had the same issue from a recent symfony 4.4 install, and fix it by removing the following parameter from doctrine_migrations.yaml: