Category : php

I’ve got this code snippet written by another dev $date = DateTime::createFromFormat(‘U.u’, microtime(TRUE)); $dateMicro = $date->format(‘Y-m-d H:i:s.u’); It’s throwing this error: Error: Call to a member function format() on bool I guess which could mean createFromFormat returned false but I can’t figure out why it did that. What could be the cause of this? Thank ..

Read more

I am currently busy with some Laravel Blade Templating, but I can’t figure out why my code won’t work. I have a Controller that has three names and descriptions in an array and I need to show them on the welcome page with a foreach loop. PlanetenController.php: namespace AppHttpControllers; use IlluminateSupportFacadesRoute; class PlanetenController extends Controller ..

Read more

I’ve script in directadmin which create new clean database: #Create DB /usr/bin/mysqladmin -uda_admin -p$(cat /usr/local/directadmin/conf/mysql.conf | grep pass | cut -d= -f2 ) create ${wpconfigdbuser}; echo "CREATE USER ${wpconfigdbuser} IDENTIFIED BY ‘${dbpass}’;" | mysql -uda_admin -p$(cat /usr/local/directadmin/conf/mysql.conf | grep pass | cut -d= -f2 ); echo "GRANT ALL PRIVILEGES ON ${wpconfigdbuser}.* TO ${wpconfigdbuser} IDENTIFIED BY ..

Read more

I have 3 lists. The first has the client names (duplicates allowed), the second has a project code associated to the client list (multiple codes are associated to a client) and the third has a list of items associated to the project code (only item per project code allowed). //First Dropdown – Should be getting ..

Read more

In my Export class I registered an AfterSheet event within registerEvents. This works perfectly, when I Download an Excel file. That code runs and modifies the sheet. SheetsExport.php: public function registerEvents(): array { return [ AfterSheet::class => function (AfterSheet $event) { … But in my tests this does not work: $this->get(‘/api/export/model_dummies’)->assertStatus(200); Excel::assertDownloaded(‘model_dummies.xlsx’, function (SheetsExport $export) ..

Read more