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 | |
if (! function_exists('array_column_recursive')) { | |
/** | |
* Return the values from a single column in the input array recursively | |
* | |
* @param array $array | |
* @param int|string|null $columnKey | |
* @param int|string|null $indexKey | |
* @return array |
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 | |
if (! function_exists('version_sort')) { | |
/** | |
* Sort array with version_compare. | |
* @link https://stackoverflow.com/a/48974986/5067386 | |
* @param string[] $versions | |
* @return void | |
*/ | |
function version_sort(array $versions) { |
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\Middleware; | |
use Closure; | |
class DefaultGuardChangeDynamically | |
{ | |
/** | |
* Handle an incoming request. |
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\Concerns; | |
use Illuminate\Database\Eloquent\Factories\Factory; | |
use Illuminate\Database\Eloquent\Factories\HasFactory as BaseTrait; | |
trait HasFactory | |
{ | |
use BaseTrait; |
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\Models; | |
class Example extends Model | |
{ | |
/** | |
* @see Post | |
* @param string $value | |
* @return Post|\Illuminate\Database\Eloquent\Model |
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\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\URL; | |
use Illuminate\Support\Str; | |
class RestrictFromReferer | |
{ |
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\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
class CreateAttachmentsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
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\Middleware; | |
use Closure; | |
use Illuminate\Support\Facades\File; | |
use Illuminate\Support\Str; | |
class PreferredLanguage | |
{ |
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\Middleware; | |
use Closure; | |
use Spatie\Permission\Middlewares\PermissionMiddleware as Middleware; | |
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | |
class Permission404Middleware extends Middleware | |
{ |
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\Packages; | |
use Faker\Generator; | |
/** | |
* @method string randomBody($maxDepth = 4, $maxWidth = 4) | |
*/ | |
class FakerGenerator extends Generator |