Changed datasource config in database.php to localhost to connect successfully to db