It will be a good idea to create css and js versioning for easy loading and somehow for changes to take effect.
You can add these code in your blade layout for your laravel project
Route::get('changeenv/{key?}/{value?}',"controller@methodname");
In your controller
public function changeEnv($key, $value)
{
$path = app()->environmentFilePath();
$escaped = preg_quote('=' . env($key), '/');
file_put_contents($path, preg_replace(
"/^{$key}{$escaped}/m",
"{$key}={$value}",
file_get_contents($path)
));
return "env change successfully " . env($key);
}
In your browser, you could type this to change the .env's CAPTCHA value
https://mysite.com/changeenv/CAPTCHA/new_value
brew update && brew install mailhog
For Laravel .env
MAIL_DRIVER=smtp
MAIL_HOST=0.0.0.0
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Run in Terminal
mailhog
Testing Email
Open this link Mailhog UI
build:adminx font js
js:
npm run build
font:
npm run gulp iconfont
adminx:
cd admin; npm run build
brew install fontforge
brew install ttfautohint fontforge (optional)
brew link fontforge
private function getGeoLocation($address)
{
try {
$url = 'https://maps.google.com/maps/api/geocode/json';
$address = str_replace(["'", '"'], " ", $address);
$address = str_replace([" ", " "], "+", $address);
$query_array = array(
'address' => $address,
'key' => env('GOOGLE_MAP_API_KEY')
);
$query = http_build_query($query_array);
$content = file_get_contents($url . '?' . $query);
$output = json_decode($content);
$result = [];
if ($output->status == "OK") {
$result['latitude'] = $output->results[0]->geometry->location->lat;
$result['longitude'] = $output->results[0]->geometry->location->lng;
}
return $result;
} catch (\Exception $ex) {
return [];
}
}