Skip to content

I can’t add a column to a table with data in laravel

I’m doing this: create: Code: The migration runs without problems, but I am going to check the table and the column is not added, if I create a new migration and put a total to the new column, it says that the column already exists, what error is occurring? Answer go to the database table and delete the…

Problem making previous next posts with php

I searched everywhere and found out you can use “–” before and “++” after a variable to substract or increase it by 1, but it just wont work properly, here’s my code Answer You can read more on increment and decrement operators. It basically does not applies to what you wan…

Using a php array as argument to a JavaScript function

I’ve a function which feeds a chart with fixed data: I’d like to replace the fixed data with the one read from a DB table containing two columns: date and temperature. The read data is stored in the $json variable: Here’s my bad code: How can I make this work? EDIT: Code after being edited w…

Laravel Resource controller

How do I tell my API to display a particular result based on another column? e.g. localhost:8000/api/gadgets/{{id}} Normally it returns the particular information of the specific gadget with that ID and localhost:8000/api/gadgets/{{imei_code}} does not return any value or an error whereas imei_code is a colum…

RPI Launch VLC via php on local machine

I am trying to open a .mp4 file in VLC via the PHP exec command on a RPI 3 SITUATION I access localhost and select the .mp4 file I want to play on a mobile device. RESULT I want PHP to open the video file using VLC on the host machine, which is connected via HDMI to a display. The