- Install Geocoder Laravel: https://geocoder-php.org/docs/
- Publish config
php artisan vendor:publish
(Look for Geocoder) - Setup your Google Geocoding API-Key in
config/geocoder.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Refactor #1: | |
*/ | |
// Before | |
if ($user->type === 'admin' || $user->type === 'mod' || $user->type === 'author') { | |
// Do something. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. In PhpStorm go to: Preferences > Editor > Live Templates. | |
// 2. Click on the + button on the top right to create a new template. | |
// 3. Enter "@test" (no quotes) in the Abbreviation field, and give the template a name. (mine is named test case) | |
// 4. Copy and paste the code below into the "Template text:" section in PhpStorm | |
/** @test */ | |
$NAME$ | |
public function $SNAKENAME$() | |
{ | |
$END$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function printDiv(divName){ | |
var printContents = document.getElementById(divName).innerHTML; | |
var originalContents = document.body.innerHTML; | |
document.body.innerHTML = printContents; | |
window.print(); | |
document.body.innerHTML = originalContents; |