I’m using codeigniter to query a database, and I need to conditionally compare arrays in the where clause. So basically I want to do: where_in OR where_in depending on what array has data in it. So I will have either an array of user_id OR an array of area_id’s. I’m not sure how to combine t…
Using DateTime as a one-liner in PHP
A short and simple question which I couldn’t really find an answer for. In procedural PHP I could echo a date In Object oriented PHP I have to use two lines Is it possible to do this in one line? Answer There are two options: Create a DateTime instance using parenthesis and format the result: You can us…
Why css and bootstrap is not loading in Laravel 5.3?
This is my route file… Route::group([‘middleware’ => [‘auth’]], function(){ Route::get(‘/profile/{username}’, ‘ProfileControllers@getProfile’); }); The “ProfileControllers” is this… namespace AppHttpControllers; use DB; use AppUser; us…
Laravel can only login in Incognito tab
I have a strange issue with my Laravel project. Can’t find out, when it first strated – I can only login/logout opening the app in incognito tab. And in normal tab it won’t log me out, when I am …
jQuery – Add row to datatable without reloading/refreshing
I’m trying add data to DB and show these data in same page using ajax and jQuery datatable without reloading or refreshing page. My code is saving and retrieving data to/from database. But updated data list is not showing in datatable without typing in search box or clicking on table header. Facing same…
PrestaShop: allow customers to upload PDF, AI and EPS files as product customization
I am running Prestashop 1.6.1.7 and I have the following pictureUpload() method that allows users to upload files of their choosing. By default Prestashop allows uploads of GIF, JPG, JPEG or PNG only. I’m trying to allow users the ability to upload a few more types (pdf, ai and eps specifically) Here is…
How to set the color of a Google Calendar that was created via the API
I’m using the google calendar API with PHP. I know how to create a new calendar, but how do I set the color of the calendar I’ve created? I’ve been searching for hours. I’ve tried I’ve tried both of which are undefined methods. I found documentation on how to modify the color def…
Laravel application URL with directory and route group
The laravel application url will be something like app.laravel.com{clientName}. All the routes will be following the client_name, for example app.laravel.com{clientName}home, app.laravel.com{…
Woocommerce – How to send custom emails based on payment type
Here is the problem. My woocommerce website has 3 different payment options – Check Payment Western Union Cash On Delivery If my buyer checkout with “Check Payment” I want to send him an automated …
How to install ffmpeg for PHP
I’ve successfully installed ffmpeg using ssh, as root, on my dedicated server (CentOS 7). ffmpeg works fine – but now I need to use it without root access. When i try to use ffmpeg without root access, I get the following error : The final goal is to be able to use ffmpeg inside my PHP scripts whi…