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
| var gulp = require('gulp'); | |
| var phpspec = require('gulp-phpspec'); | |
| var run = require('gulp-run'); | |
| var notify = require('gulp-notify'); | |
| gulp.task('test', function() { | |
| gulp.src('spec/**/*.php') | |
| .pipe(run('clear')) | |
| .pipe(phpspec('', { notify: true })) | |
| .on('error', notify.onError({ |
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
| {{ Form::open(['data-remote', 'data-remote-success-message' => 'I have now done the thing.']) }} | |
| {{ Form::text('name') }} | |
| {{ Form::submit('Submit', ['data-confirm' => 'Are you sure?']) }} | |
| {{ Form::close() }} |
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 | |
| $saveDir = './tests/acceptance/tmp'; | |
| $stubDir = './tests/acceptance/stubs'; | |
| $commandToGenerate = 'FooCommand'; | |
| $I = new AcceptanceTester($scenario); | |
| $I->wantTo('generate a command and handler class'); | |
| // Is there a better way to call the Artisan command? Without having to expect the framework and do ../../../? |
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 | |
| // Option 1: the follow method immediately references the relationship and saves it. | |
| class User extends Eloquent { | |
| public function follows() | |
| { | |
| return $this->belongsToMany(self::class, 'follows', 'follower_id', 'followed_id'); | |
| } |
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 | |
| // ... | |
| /** | |
| * Register a decorator for the command bus. | |
| * | |
| * @param string $decorator | |
| * @return CommandBus | |
| */ |
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 Larabook\Statuses; | |
| use Larabook\Users\User; | |
| class StatusRepository { | |
| /** | |
| * Get all statuses associated with a user. | |
| * | |
| * @param User $user |
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 | |
| use GuzzleHttp\Message\Response; | |
| class MailTestCase extends TestCase { | |
| protected $mailcatcher; | |
| function __construct() | |
| { |
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 | |
| use Faker\Factory as Faker; | |
| abstract class ApiTester extends TestCase { | |
| /** | |
| * @var Faker | |
| */ | |
| protected $fake; |
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 | |
| use Faker\Factory as Faker; | |
| abstract class ApiTester extends TestCase { | |
| /** | |
| * @var int | |
| */ | |
| protected $times = 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
| <?php | |
| use Faker\Factory as Faker; | |
| class ApiTester extends TestCase { | |
| /** | |
| * @var Faker | |
| */ | |
| protected $fake; |