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 App\User; | |
use App\Enums\RBAC; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; |
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; | |
use App\Enums\RBAC; | |
use BenSampo\Enum\Traits\CastsEnums; | |
use Illuminate\Contracts\Auth\MustVerifyEmail; | |
use Illuminate\Database\Eloquent\SoftDeletes; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Illuminate\Notifications\Notifiable; |
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\Enums; | |
use App\User; | |
use BenSampo\Enum\FlaggedEnum; | |
use function collect; | |
use function is_object; | |
final class RBAC extends FlaggedEnum |
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\Authorization; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class AutomappingPermissionsTest extends TestCase | |
{ | |
use RefreshDatabase; |
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
#! /bin/bash | |
# A very simple, primitive and slightly assuming script for creating a bootable windows 10 USB key. | |
# First we'll prepare the USB | |
parted mklabel gpt $1 | |
mkfs.fat32 $11 | |
# Then create the directories... | |
mkdir -p /mnt/Windows10_source | |
mkdir -p /mnt/Windows10_target |
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; | |
use Illuminate\Contracts\Filesystem\Filesystem; | |
use Illuminate\Support\Facades\Storage; | |
use Phar; | |
use PharData; | |
use function is_dir; | |
use function is_file; |
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\Requests; | |
use function array_dot; | |
use function fnmatch; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Collection; | |
use Illuminate\Support\Str; |
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 | |
trait HasModelStates | |
{ | |
/** | |
* The registered model states. | |
* | |
* @var array | |
*/ | |
protected $states = []; |
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\Support\Collection; | |
/** | |
* Map the values of given collection into a collection of each pair, retaining the key. | |
* | |
* @return Collection | |
*/ | |
Collection::macro('toFlatValuePairs', function () { |
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\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Process; | |
use Symfony\Component\Process\Exception\ProcessFailedException; | |
class DatabaseOptimizeCommand extends Command | |
{ |