Can’t install extensions on VSCode?

If you are trying to install extensions on VSCode but you can’t. Try to visit this site from your browser:

Most probably you will get a “This site can’t be reached” message, to solve this you have to change your default DNS to google free public DNS

If that may not work for you then yo can try to change the DNS for IPv6 to:


Here is a link for more details on changing the DNS to google DNS

How to install composer on Godaddy cPanel

If you want to install composer on a godaddy shared hosting, you can follow these steps:

On root folder type:

php installer --check
php installer
rm -f installer

to return the path of composer type:

which composer

it’ll return something like: /opt/cpanel/composer/bin/composer

then you can use composer using its full path:
php-cli /opt/cpanel/composer/bin/composer install

for ex. :

php-cli /opt/cpanel/composer/bin/composer install
php-cli /opt/cpanel/composer/bin/composer update

Also if you want to run php artisan , you can type:

/usr/bin/php-cli artisan

Can’t access DB or phpmyadmin locally

If you got an error like: “Host ‘localhost’ is not allowed to connect to this MariaDB server” you can edit the file xampp\mysql\bin\my.ini

Add this line:
after [mysqld] group.


After that, login to phpmyadmin and repair the users table as it mostly is corrupted.

Also try to rename :


How to view latest SQL statement excuted in Laravel

To view the latest sql query executed in Laravel you can



Note that you have to enable the query log before executing the query and view/print it after execution ..

A good practice is to enable it only in Local environment

if (App::environment('local')) {
    // The environment is local


How to sanitize raw data in Laravel

When doing a raw data query from user input like this:

$someVariable = Input::get("some_variable");

$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = '$someVariable'") );

we are at risk of SQL injection , to avoid that we can bin parameters to our query like this:

$someVariable = Input::get("some_variable");

$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = :somevariable"), array(
   'somevariable' => $someVariable,


Another point is that if we want to do a raw that doesn’t return a value, we can do it like this

DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=1111' );

and that way can take parameters as well

DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=:incrementStart', array('incrementStart' => 1111) );