Category : backend

Currently I am developing a site where all html codes are inside .php file. I managed send curl request to API provider and I can receive json data with code below. $curl = curl_init(‘APILINK?apikey=’.$apiKey); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 3); $output = curl_exec($curl); curl_close($curl); echo $output; These data must be rendered into html, but before ..

Read more

I have a data structure like you can see in the picture above. I want some fields in the root collections, but I don’t know how can I can get that. public function index (Request $request) { $draw = $request->get(‘draw’); $start = $request->get(‘start’); $length = $request->get(‘length’); $order = Order::with(‘user’); $total_order = $order->count(); $orders = Order::with(‘user’)->offset($start)->limit($length)->get(); ..

Read more

I am using the following code https://www.businessbloomer.com/woocommerce-calculate-sales-coupon-code/ that allows me to display the total amount of sales generated by a given coupon code in a new tab on WooCommerce "Reports". /** * @snippet Get Total Sales by COUPON * @how-to Get CustomizeWoo.com FREE * @sourcecode https://businessbloomer.com/?p=72576 * @author Rodolfo Melogli * @testedwith WooCommerce 3.0.7 */ ..

Read more

I’m trying to make a query where returns me the results, based on a request word, but I have to filter with the relationship columns as well. Example: Payment::byUnity($unityId) ->with([‘contract:id,nome,sigla’]) ->latest(‘id’) ->where(‘id’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘name’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘contract.name’, ‘LIKE’, ‘%’ . $request->input(‘search’) . ‘%’) ->orWhere(‘contract.description’, ‘LIKE’, ‘%’ ..

Read more