Skip to content

Instantly share code, notes, and snippets.

Laracasts laracasts

Block or report user

Report or block laracasts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7628742
@mixin linear-gradient($options...) {
background: -webkit-linear-gradient($details);
background: -moz-linear-gradient($details);
background: linear-gradient($details);
}
.foo {
@include linear-gradient(top, red, green);
}
@laracasts
laracasts / test.php
Last active Jul 10, 2018
Transactions for functional/integration tests.
View test.php
<?php
class ExampleTest extends TestCase {
public function setUp()
{
parent::setUp();
DB::beginTransaction();
}
@laracasts
laracasts / gulpfile.js
Last active Aug 29, 2019
Example Laravel-specific Gulpfile from Laracasts.com
View gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var notify = require('gulp-notify');
var sass = require('gulp-ruby-sass');
var autoprefix = require('gulp-autoprefixer');
var minifyCSS = require('gulp-minify-css')
var coffee = require('gulp-coffee');
var exec = require('child_process').exec;
var sys = require('sys');
@laracasts
laracasts / ApiTester.php
Created Apr 9, 2014
Incremental APIs: Level 9 - Tests (Readable Ones!)
View ApiTester.php
<?php
use Faker\Factory as Faker;
class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
View ApiTester.php
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var int
*/
protected $times = 1;
@laracasts
laracasts / ApiTester.php
Last active May 14, 2018
Incremental APISs: Refactoring Tests and Traits
View ApiTester.php
<?php
use Faker\Factory as Faker;
abstract class ApiTester extends TestCase {
/**
* @var Faker
*/
protected $fake;
View gist:99535e8db4298056b76d
<?= 'Add your Wii U username below'; ?>
@laracasts
laracasts / MailTestCase.php
Created Jun 14, 2014
Use Mailcatcher to test email.
View MailTestCase.php
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
@laracasts
laracasts / StatusRepository.php
Last active May 19, 2018
Integration Testing Repositories That Use Eloquent (with Codeception)
View StatusRepository.php
<?php namespace Larabook\Statuses;
use Larabook\Users\User;
class StatusRepository {
/**
* Get all statuses associated with a user.
*
* @param User $user
View ex.php
<?php
// ...
public function store(RegistrationForm $form)
{
$form->validate(); // throws exception if fails
// save stuff
}
You can’t perform that action at this time.