$envName = config('app.env');
$releaseCommitName = exec('git rev-parse --short HEAD');
$releaseCommitHash = exec('git rev-parse HEAD');
$commitLink = "https://bitbucket.org/me/my-repo/commits/{$releaseCommitHash}";
Artisan::call('notify:slack', array(
"message" => "Commit #{$releaseCommitName} deployed successfully to {$envName} server {$commitLink}.",
"actionText" => "View Site",
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
| $files = Finder::create()->in(base_path('routes/micro'))->name('*.php'); | |
| Collection::make($files)->each(function(SplFileInfo $file){ | |
| require_once $file->getRealPath(); | |
| }); |
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 | |
| Route::getFacadeRoot() | |
| ->getRoutes() | |
| ->getByAction('App\Http\Controllers\Auth\LoginController@login') | |
| ->name('login.submit'); |
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
| data: ()=>({ | |
| validator: new Validator | |
| }), | |
| /** | |
| * Validator API | |
| */ | |
| this.validator.clear() | |
| this.validator.all() | |
| this.validator.has('myField') |
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 | |
| // Add "api_token" field to your user model | |
| // https://medium.com/@danielalvidrez/how-to-use-laravels-built-in-token-auth-6b6f6c26d059 | |
| // http://laravel.local/api/resources/pages/1?api_token=XXX | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Config; | |
| use Illuminate\Support\Facades\App; | |
| Route::middleware('auth:api')->get('resources/{resource}/{page?}', function ($resource, $page = 1) { |
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
| <template> | |
| <div class="form-group"> | |
| <label for="location">{{ label }}</label> | |
| <input type="text" id="location" :value="value" ref="location" class="form-control" /> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| props: { |
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> | |
| export default { | |
| name: 'v-autocomplete', | |
| props: { | |
| settings: { | |
| type: Object, | |
| default: () => ({ | |
| types: ['(regions)'], | |
| componentRestrictions: {country: "us"} | |
| }) |
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 | |
| namespace Tests\Unit; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Http\UploadedFile; | |
| use Illuminate\Support\Facades\Storage; | |
| use Intervention\Image\Facades\Image; | |
| use App\Nova\Invokables\FileUploader; | |
| use Tests\TestCase; | |
| use App\Media; | |
| class FileUploaderTest extends TestCase |
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 namespace App\Nova\Invokables; | |
| use App\Media; | |
| use Illuminate\Http\Request; | |
| use Illuminate\Http\UploadedFile; | |
| use Illuminate\Support\Str; | |
| use Intervention\Image\Facades\Image; | |
| use Spatie\ImageOptimizer\OptimizerChain; | |
| use Spatie\ImageOptimizer\Optimizers\Gifsicle; | |
| use Spatie\ImageOptimizer\Optimizers\Jpegoptim; | |
| use Spatie\ImageOptimizer\Optimizers\Optipng; |
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
| // Usage: Replace Blade Style Variables and run each line youself to insure it works. | |
| export DEBIAN_FRONTEND=noninteractive | |
| // Set Server Hostname | |
| hostname {{HOSTNAME}} | |
| // Set Installer Selections | |
| debconf-set-selections <<< "postfix postfix/mailname string {{HOSTNAME}}" | |
| debconf-set-selections <<< "postfix postfix/main_mailer_type string \'Internet Site\'" |