Skip to content

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) …

leaflet marker doenst show

After I make a change at configuration of the sql, the map does not show, I tried to echo the php code at the bottom, but it still fine I look to my other project but it still work fine. <script&…

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…

Filter results by pivot data on laravel / eloquent

I need to filter my data that match a specified criteria, see the example below DB SCHEME user id name company id name user_company user_id company_id date note DATA user | id | name | | — | -…

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…

Remove Parts of String in php [closed]

is there any way to do this in PHP? $first_string = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”; $second_strong = “GHIJKLM”; function str_slayer($first_string, $second_string ){ //doing some …