Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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; | |
use Illuminate\Contracts\Auth\Authenticatable; | |
use Illuminate\Foundation\Http\FormRequest; | |
use Illuminate\Validation\ValidationException; | |
use Illuminate\Validation\Validator; | |
use Symfony\Component\HttpFoundation\ParameterBag; | |
use function PHPUnit\Framework\assertFalse; |
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
/** | |
* The good people at the Babel project opted to use global-ish variables (`WeakMap`s) and functions | |
* to track the private attributes of class instances. | |
* | |
* Looking at the implementation, I think the functions used to access the private attributes of the | |
* classes allow you to have private getters and setters (not sure why you might want that, perhaps | |
* for internally accessible computed properties) but it sure is neat. | |
*/ | |
"use strict"; |
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 Vehikl\Feature\Tests; | |
use PHPUnit\Framework\TestCase; | |
class FeatureToggleTest extends TestCase | |
{ | |
public function test_it_executes_the_on_method_when_the_feature_is_on() | |
{ |
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 Illuminate\Eloquent\Model; | |
class Foo extends Model | |
{ | |
protected $attributes = [ | |
'parent_id' => null, | |
]; | |
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 | |
class Event | |
{ | |
public function fights() | |
{ | |
return $this->hasMany(Fight::class)->orderBy('fightcard_order'); | |
} | |
public function topFight() |
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\Http; | |
/** | |
* ?filter[foo]=bar&filter[qux]=baz | |
*/ | |
trait FiltersRequests | |
{ | |
private function filter($query) |
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
diff --git a/routes/api.php b/routes/api.php | |
index 6b907f3..0e8d957 100644 | |
--- a/routes/api.php | |
+++ b/routes/api.php | |
@@ -13,6 +13,11 @@ use Illuminate\Http\Request; | |
| | |
*/ | |
-Route::get('/user', function (Request $request) { | |
- return $request->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 | |
function expiryDates() { | |
$january = Carbon::now()->startOfYear(); | |
$eachMonth = new DateInterval('P1M'); | |
$december = Carbon::now()->endOfYear(); | |
return collect(new DatePeriod($january, $eachMonth, $december))->map(function ($date) { | |
return $date->format('m/Y'); | |
}); | |
} |
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 Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateTitlesTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* |
NewerOlder