id stringlengths 6 6 | text stringlengths 20 17.2k | title stringclasses 1
value |
|---|---|---|
193264 | public function testImplicitRouteBindingChildHasUlids()
{
$user = ImplicitBindingUser::create(['name' => 'Michael Nabil']);
$post = ImplicitBindingPost::create(['user_id' => $user->id]);
$tag = ImplicitBindingTag::create([
'slug' => 'slug',
'post_id' => $post->id,
... | |
193273 | public function testRouteBindingsAreProperlySaved()
{
$this->routeCollection->add($this->newRoute('GET', 'posts/{post:slug}/show', [
'uses' => 'FooController@index',
'prefix' => 'profile/{user:username}',
'as' => 'foo',
]));
$route = $this->collection()->... | |
193275 | <?php
namespace Illuminate\Tests\Integration\Routing;
use Illuminate\Support\Facades\Route;
use Orchestra\Testbench\TestCase;
class FluentRoutingTest extends TestCase
{
public static $value = '';
public function testMiddlewareRunWhenRegisteredAsArrayOrParams()
{
$controller = function () {
... | |
193298 | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class DynamicContentIsShown extends Migration
{
public function up()
{
Schema::create('blogs', function (Blueprint $table) {
... | |
193299 | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class DynamicContentNotShown extends Migration
{
public function up()
{
Schema::create('blogs', function (Blueprint $table) {
... | |
193315 | <?php
namespace Illuminate\Tests\Integration\Validation;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use Illuminate\Tests\Integration\Database\DatabaseTestCase;
use Illuminate\Translation\ArrayLoader;
use Illumina... | |
193364 | protected function cleanAsset($asset)
{
$path = public_path('build/assets');
unlink($path.$asset);
rmdir($path);
}
protected function makeViteHotFile($path = null)
{
app()->usePublicPath(__DIR__);
$path ??= public_path('hot');
file_put_contents($path,... | |
193365 | <?php
namespace Illuminate\Tests\Foundation;
use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\Access\Response;
use Illuminate\Container\Container;
use Illuminate\Contracts\Translation\Translator;
use Illuminate\Contracts\Validation\Factory as ValidationFactoryContract;
use Illumin... | |
193367 | protected function createMockRedirector($request)
{
$redirector = $this->mocks['redirector'] = m::mock(Redirector::class);
$redirector->shouldReceive('getUrlGenerator')->zeroOrMoreTimes()
->andReturn($generator = $this->createMockUrlGenerator());
$redirector->shouldRecei... | |
193379 | <?php
namespace Illuminate\Tests\Foundation;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\Access\Gate;
use Illuminate\Auth\Access\Response;
use Illuminate\Container\Container;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;... | |
193388 | <?php
namespace Illuminate\Tests\Foundation\Bootstrap;
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Mockery as m;
use PHPUnit\Framework\TestCase;
class LoadEnvironmentVariablesTest extends TestCase
{
protected function tearDown(): void
{
uns... | |
193400 | <?php
namespace Illuminate\Tests\Foundation\Testing\Concerns;
use Illuminate\Contracts\Routing\Registrar;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests;
use Illuminate\Http\RedirectResponse;
use Orchestra\Testbench\TestCase;
class MakesHttpRequest... | |
193430 | <?php
namespace Illuminate\Tests\Bus;
use Illuminate\Bus\Queueable;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
class QueueableTest extends TestCase
{
public static function connectionDataProvider(): array
{
return [
'uses string' => ['redis', 'redis'],
... | |
193438 | class FilesystemAdapterTest extends TestCase
{
private $tempDir;
private $filesystem;
private $adapter;
protected function setUp(): void
{
$this->tempDir = __DIR__.'/tmp';
$this->filesystem = new Filesystem(
$this->adapter = new LocalFilesystemAdapter($this->tempDir)
... | |
193555 | [DataProvider('collectionClassProvider')]
public function testPluckWithArrayAccessValues($collection)
{
$data = new $collection([
new TestArrayAccessImplementation(['name' => 'taylor', 'email' => 'foo']),
new TestArrayAccessImplementation(['name' => 'dayle', 'email' => 'bar']),
... | |
193642 | public function testGetWithArrayQueryParamEncodes()
{
$this->factory->fake();
$this->factory->get('http://foo.com/get', ['foo;bar; space test' => 'laravel']);
$this->factory->assertSent(function (Request $request) {
return $request->url() === 'http://foo.com/get?foo%3Bbar%3B%20... | |
193667 | class HttpResponseTest extends TestCase
{
protected function tearDown(): void
{
m::close();
}
public function testJsonResponsesAreConvertedAndHeadersAreSet()
{
$response = new Response(new ArrayableStub);
$this->assertSame('{"foo":"bar"}', $response->getContent());
$... | |
193697 | <?php
namespace Illuminate\Tests\View\Blade;
use Illuminate\View\ComponentAttributeBag;
class BladePropsTest extends AbstractBladeTestCase
{
public function testPropsAreCompiled()
{
$this->assertSame('<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;
$__newAttributes = [];
$__propNam... | |
193760 | <?php
namespace Illuminate\Tests\View\Blade;
class BladeSessionTest extends AbstractBladeTestCase
{
public function testSessionsAreCompiled()
{
$string = '
@session(\'status\')
<span>{{ $value }}</span>
@endsession';
$expected = '
<?php $__sessionArgs = [\'status\'];
if (session()->has($__... | |
193798 | public function testItUtilisesTheNullDriverDuringTestsWhenNullDriverUsed()
{
$config = $this->app->make('config');
$config->set('logging.default', null);
$config->set('logging.channels.null', [
'driver' => 'monolog',
'handler' => NullHandler::class,
]);
... | |
193799 | public function testWrappingHandlerInFingersCrossedWhenActionLevelIsUsed()
{
$config = $this->app['config'];
$config->set('logging.channels.fingerscrossed', [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'level' => 'debug',
'action_level'... | |
193815 | lic function testRouteMacro()
{
$router = $this->getRouter();
Route::macro('breadcrumb', function ($breadcrumb) {
$this->action['breadcrumb'] = $breadcrumb;
return $this;
});
$router->get('foo', function () {
return 'bar';
})->breadcrumb... | |
193816 | lic function testControllerCallActionMethodParameters()
{
$router = $this->getRouter();
// Has one argument but receives two
unset($_SERVER['__test.controller_callAction_parameters']);
$router->get(($str = Str::random()).'/{one}/{two}', RouteTestAnotherControllerWithParameterStub::c... | |
193817 | lic function testWherePatternsProperlyFilter()
{
$request = Request::create('foo/123', 'GET');
$route = new Route('GET', 'foo/{bar}', function () {
//
});
$route->where('bar', '[0-9]+');
$this->assertTrue($route->matches($request));
$request = Request::cr... | |
193820 | lic function testResourceRouting()
{
$router = $this->getRouter();
$router->resource('foo', 'FooController');
$routes = $router->getRoutes();
$this->assertCount(7, $routes);
$router = $this->getRouter();
$router->resource('foo', 'FooController', ['only' => ['update']... | |
193827 | nction testControllerRoutesWithADefaultNamespace()
{
$url = new UrlGenerator(
$routes = new RouteCollection,
Request::create('http://www.foo.com/')
);
$url->setRootControllerNamespace('namespace');
/*
* Controller Route Route
*/
$ro... | |
193839 | public function testCanRegisterGroupWithMiddleware()
{
$this->router->middleware('group-middleware')->group(function ($router) {
$router->get('users', function () {
return 'all-users';
});
});
$this->seeResponse('all-users', Request::create('users', '... | |
193840 | public function testCanRegisterResourcesWithOnlyOption()
{
$this->router->resources([
'resource-one' => RouteRegistrarControllerStubOne::class,
'resource-two' => RouteRegistrarControllerStubTwo::class,
'resource-three' => RouteRegistrarControllerStubThree::class,
... | |
193841 | public function testCanRegisterApiResourcesWithExceptOption()
{
$this->router->apiResources([
'resource-one' => RouteRegistrarControllerStubOne::class,
'resource-two' => RouteRegistrarControllerStubTwo::class,
'resource-three' => RouteRegistrarControllerStubThree::class,
... | |
193842 | public function testWhereNumberRegistration()
{
$wheres = ['foo' => '[0-9]+', 'bar' => '[0-9]+'];
$this->router->get('/{foo}/{bar}')->whereNumber(['foo', 'bar']);
$this->router->get('/api/{bar}/{foo}')->whereNumber(['bar', 'foo']);
/** @var \Illuminate\Routing\Route $route */
... | |
193846 | <?php
use BaseController;
class FooController extends BaseController
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
}
/**
* Show the form for creating a new resource.
*
* @return \Illumina... | |
193847 | <?php
use BaseController;
class FooController extends BaseController
{
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*
* @return ... | |
193869 | public function testItChoosesValidRecordsUsingWhereNotRule()
{
$rule = new Exists('users', 'id');
$rule->whereNot('type', 'baz');
User::create(['id' => '1', 'type' => 'foo']);
User::create(['id' => '2', 'type' => 'bar']);
User::create(['id' => '3', 'type' => 'baz']);
... | |
193920 | unction testValidateUnique()
{
$trans = $this->getIlluminateArrayTranslator();
$v = new Validator($trans, ['email' => 'foo'], ['email' => 'Unique:users']);
$mock = m::mock(DatabasePresenceVerifierInterface::class);
$mock->shouldReceive('setConnection')->once()->with(null);
$m... | |
193934 | alse($v->passes());
// Ensure commas are not interpreted as parameter separators
$v = new Validator($trans, ['x' => 'a,b'], ['x' => 'Regex:/^a,b$/i']);
$this->assertTrue($v->passes());
$v = new Validator($trans, ['x' => '12'], ['x' => 'Regex:/^12$/i']);
$this->assertTrue($v->pa... | |
193936 | > 'Before:2012-01-01']);
$this->assertFalse($v->passes());
$v = new Validator($trans, ['x' => new Carbon('2000-01-01')], ['x' => 'Before:2012-01-01']);
$this->assertTrue($v->passes());
$v = new Validator($trans, ['x' => [new Carbon('2000-01-01')]], ['x' => 'Before:2012-01-01']);
... | |
193937 | ], ['x' => 'before:31/02/2012']);
$this->assertTrue($v->fails());
$v = new Validator($trans, ['x' => '31/12/2000'], ['x' => 'date_format:d/m/Y|before:31/12/2012']);
$this->assertTrue($v->passes());
$v = new Validator($trans, ['x' => '31/12/2012'], ['x' => 'after:31/12/2000']);
... | |
194012 | class Encrypter implements EncrypterContract, StringEncrypter
{
/**
* The encryption key.
*
* @var string
*/
protected $key;
/**
* The previous / legacy encryption keys.
*
* @var array
*/
protected $previousKeys = [];
/**
* The algorithm used for encryp... | |
194016 | public function select($query, $bindings = [], $useReadPdo = true)
{
return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) {
if ($this->pretending()) {
return [];
}
// For select statements, we'll simply execute the query and... | |
194023 | class DatabaseManager implements ConnectionResolverInterface
{
use Macroable {
__call as macroCall;
}
/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
/**
* The database connection factory instance.
*
... | |
194025 | <?php
namespace Illuminate\Database;
use Closure;
interface ConnectionInterface
{
/**
* Begin a fluent query against a database table.
*
* @param \Closure|\Illuminate\Database\Query\Builder|string $table
* @param string|null $as
* @return \Illuminate\Database\Query\Builder
*/
... | |
194061 | <?php
namespace Illuminate\Database\Migrations;
use Illuminate\Console\View\Components\BulletList;
use Illuminate\Console\View\Components\Info;
use Illuminate\Console\View\Components\Task;
use Illuminate\Console\View\Components\TwoColumnDetail;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Conne... | |
194062 | protected function rollbackMigrations(array $migrations, $paths, array $options)
{
$rolledBack = [];
$this->requireFiles($files = $this->getMigrationFiles($paths));
$this->fireMigrationEvent(new MigrationsStarted('down'));
$this->write(Info::class, 'Rolling back migrations.');
... | |
194067 | <?php
namespace Illuminate\Database\Migrations;
abstract class Migration
{
/**
* The name of the database connection to use.
*
* @var string|null
*/
protected $connection;
/**
* Enables, if supported, wrapping the migration within a transaction.
*
* @var bool
*/
... | |
194068 | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
//
}
/**
* Reverse the migrations.
*/
... | |
194073 | <?php
namespace Illuminate\Database\Eloquent;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Support\Collection as BaseCollection;
/**
* @method static \Illuminate\Database\Eloquent\Builder<static> withTrashed(bool $withTrashed = true)
* @method static \Illuminate\Database\Eloque... | |
194082 | /**
* Execute the query and get the first result or throw an exception.
*
* @param array|string $columns
* @return TModel
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException<TModel>
*/
public function firstOrFail($columns = ['*'])
{
if (! is_null($model ... | |
194085 | /**
* Apply the given scope on the current builder instance.
*
* @param callable $scope
* @param array $parameters
* @return mixed
*/
protected function callScope(callable $scope, array $parameters = [])
{
array_unshift($parameters, $this);
$query = $this->getQ... | |
194088 | <?php
namespace Illuminate\Database\Eloquent;
interface Scope
{
/**
* Apply the scope to a given Eloquent query builder.
*
* @param \Illuminate\Database\Eloquent\Builder $builder
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function apply(Build... | |
194091 | public static function isIgnoringTouch($class = null)
{
$class = $class ?: static::class;
if (! get_class_vars($class)['timestamps'] || ! $class::UPDATED_AT) {
return true;
}
foreach (static::$ignoreOnTouch as $ignoredClass) {
if ($class === $ignoredClass ||... | |
194094 | /**
* Set the keys for a select query.
*
* @param \Illuminate\Database\Eloquent\Builder<static> $query
* @return \Illuminate\Database\Eloquent\Builder<static>
*/
protected function setKeysForSelectQuery($query)
{
$query->where($this->getKeyName(), '=', $this->getKeyForSelectQu... | |
194095 | public function registerGlobalScopes($builder)
{
foreach ($this->getGlobalScopes() as $identifier => $scope) {
$builder->withGlobalScope($identifier, $scope);
}
return $builder;
}
/**
* Get a new query builder that doesn't have any global scopes.
*
* @ret... | |
194096 | /**
* Get the table associated with the model.
*
* @return string
*/
public function getTable()
{
return $this->table ?? Str::snake(Str::pluralStudly(class_basename($this)));
}
/**
* Set the table associated with the model.
*
* @param string $table
* @r... | |
194099 | <?php
namespace Illuminate\Database\Eloquent;
class SoftDeletingScope implements Scope
{
/**
* All of the extensions to be added to the builder.
*
* @var string[]
*/
protected $extensions = ['Restore', 'RestoreOrCreate', 'CreateOrRestore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed'];
... | |
194119 | <?php
namespace Illuminate\Database\Eloquent\Relations;
class MorphPivot extends Pivot
{
/**
* The type of the polymorphic relation.
*
* Explicitly define this so it's not included in saved attributes.
*
* @var string
*/
protected $morphType;
/**
* The value of the poly... | |
194126 | public function getForeignKeyName()
{
return $this->foreignKey;
}
/**
* Get the fully qualified foreign key of the relationship.
*
* @return string
*/
public function getQualifiedForeignKeyName()
{
return $this->child->qualifyColumn($this->foreignKey);
}
... | |
194128 | class BelongsToMany extends Relation
{
use InteractsWithDictionary, InteractsWithPivotTable;
/**
* The intermediate table for the relation.
*
* @var string
*/
protected $table;
/**
* The foreign key of the parent model.
*
* @var string
*/
protected $foreignP... | |
194129 | public function wherePivot($column, $operator = null, $value = null, $boolean = 'and')
{
$this->pivotWheres[] = func_get_args();
return $this->where($this->qualifyPivotColumn($column), $operator, $value, $boolean);
}
/**
* Set a "where between" clause for a pivot table column.
*
... | |
194130 | public function firstOrNew(array $attributes = [], array $values = [])
{
if (is_null($instance = $this->related->where($attributes)->first())) {
$instance = $this->related->newInstance(array_merge($attributes, $values));
}
return $instance;
}
/**
* Get the first re... | |
194140 | public function firstOr($columns = ['*'], ?Closure $callback = null)
{
if ($columns instanceof Closure) {
$callback = $columns;
$columns = ['*'];
}
if (! is_null($model = $this->first($columns))) {
return $model;
}
return $callback();
... | |
194156 | trait InteractsWithPivotTable
{
/**
* Toggles a model (or models) from the parent.
*
* Each existing model is detached, and non existing ones are attached.
*
* @param mixed $ids
* @param bool $touch
* @return array
*/
public function toggle($ids, $touch = true)
{
... | |
194157 | protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch)
{
$pivot = $this->getCurrentlyAttachedPivots()
->where($this->foreignPivotKey, $this->parent->{$this->parentKey})
->where($this->relatedPivotKey, $this->parseId($id))
... | |
194158 | /**
* Create a new pivot model instance.
*
* @param array $attributes
* @param bool $exists
* @return \Illuminate\Database\Eloquent\Relations\Pivot
*/
public function newPivot(array $attributes = [], $exists = false)
{
$attributes = array_merge(array_column($this->pivot... | |
194163 | <?php
namespace Illuminate\Database\Eloquent\Casts;
class Attribute
{
/**
* The attribute accessor.
*
* @var callable
*/
public $get;
/**
* The attribute mutator.
*
* @var callable
*/
public $set;
/**
* Indicates if caching is enabled for this attribu... | |
194167 | <?php
namespace Illuminate\Database\Eloquent\Casts;
use Illuminate\Contracts\Database\Eloquent\Castable;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Support\Collection;
use InvalidArgumentException;
class AsCollection implements Castable
{
/**
* Get the caster class to use whe... | |
194186 | trait QueriesRelationships
{
/**
* Add a relationship count / exists condition to the query.
*
* @param \Illuminate\Database\Eloquent\Relations\Relation<*, *, *>|string $relation
* @param string $operator
* @param int $count
* @param string $boolean
* @param \Closure|null... | |
194188 | /**
* Add a polymorphic relationship condition to the query with a where clause.
*
* @param \Illuminate\Database\Eloquent\Relations\MorphTo<*, *>|string $relation
* @param string|array $types
* @param \Closure|string|array|\Illuminate\Contracts\Database\Query\Expression $column
* @pa... | |
194196 | protected function newBelongsToMany(Builder $query, Model $parent, $table, $foreignPivotKey, $relatedPivotKey,
$parentKey, $relatedKey, $relationName = null)
{
return new BelongsToMany($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKe... | |
194198 | <?php
namespace Illuminate\Database\Eloquent\Concerns;
use BackedEnum;
use Brick\Math\BigDecimal;
use Brick\Math\Exception\MathException as BrickMathException;
use Brick\Math\RoundingMode;
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use DateTimeImmutable;
use DateTimeInterface;
use Illuminate\Contracts\Da... | |
194199 | trait HasAttributes
{
/**
* The model's attributes.
*
* @var array
*/
protected $attributes = [];
/**
* The model attribute's original state.
*
* @var array
*/
protected $original = [];
/**
* The changed model attributes.
*
* @var array
*... | |
194200 | /**
* Get all of the appendable values that are arrayable.
*
* @return array
*/
protected function getArrayableAppends()
{
if (! count($this->appends)) {
return [];
}
return $this->getArrayableItems(
array_combine($this->appends, $this->append... | |
194202 | protected function getEnumCastableAttributeValue($key, $value)
{
if (is_null($value)) {
return;
}
$castType = $this->getCasts()[$key];
if ($value instanceof $castType) {
return $value;
}
return $this->getEnumCaseFromValue($castType, $value);... | |
194204 | protected function asDateTime($value)
{
// If this value is already a Carbon instance, we shall just return it as is.
// This prevents us having to re-instantiate a Carbon instance when we know
// it already is one, which wouldn't be fulfilled by the DateTime check.
if ($value instan... | |
194206 | /**
* Determine if any of the given attributes were changed when the model was last saved.
*
* @param array $changes
* @param array|string|null $attributes
* @return bool
*/
protected function hasChanges($changes, $attributes = null)
{
// If no specific attributes were ... | |
194207 | public static function cacheMutatedAttributes($classOrInstance)
{
$reflection = new ReflectionClass($classOrInstance);
$class = $reflection->getName();
static::$getAttributeMutatorCache[$class] =
collect($attributeMutatorMethods = static::getAttributeMarkedMutatorMethods($class... | |
194208 | <?php
namespace Illuminate\Database\Eloquent\Concerns;
use Closure;
use Illuminate\Database\Eloquent\Attributes\ScopedBy;
use Illuminate\Database\Eloquent\Scope;
use Illuminate\Support\Arr;
use InvalidArgumentException;
use ReflectionClass;
trait HasGlobalScopes
{
/**
* Boot the has global scopes trait for ... | |
194217 | <?php
namespace Illuminate\Database\Eloquent\Concerns;
trait GuardsAttributes
{
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [];
/**
* The attributes that aren't mass assignable.
*
* @var array<string>|bool
*/
... | |
194218 | <?php
namespace Illuminate\Database\Schema;
use Closure;
use Illuminate\Database\Connection;
use Illuminate\Database\Eloquent\Concerns\HasUlids;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Schema\Grammars\Grammar;
use Illuminate\Database\Schema\Grammars\MySqlGrammar;
use Illuminate\Database\Sche... | |
194220 | /**
* Indicate that the polymorphic columns should be dropped.
*
* @param string $name
* @param string|null $indexName
* @return void
*/
public function dropMorphs($name, $indexName = null)
{
$this->dropIndex($indexName ?: $this->createIndexName('index', ["{$name}_type"... | |
194221 | /**
* Create a new tiny integer (1-byte) column on the table.
*
* @param string $column
* @param bool $autoIncrement
* @param bool $unsigned
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function tinyInteger($column, $autoIncrement = false, $unsigned = fal... | |
194225 | <?php
namespace Illuminate\Database\Schema;
use Illuminate\Support\Fluent;
/**
* @method $this after(string $column) Place the column "after" another column (MySQL)
* @method $this always(bool $value = true) Used as a modifier for generatedAs() (PostgreSQL)
* @method $this autoIncrement() Set INTEGER columns as a... | |
194231 | <?php
namespace Illuminate\Database\Schema;
use Illuminate\Support\Str;
class ForeignIdColumnDefinition extends ColumnDefinition
{
/**
* The schema builder blueprint instance.
*
* @var \Illuminate\Database\Schema\Blueprint
*/
protected $blueprint;
/**
* Create a new foreign ID c... | |
194266 | protected function compileCreateEncoding($sql, Connection $connection, Blueprint $blueprint)
{
// First we will set the character set if one has been set on either the create
// blueprint itself or on the root configuration for the connection that the
// table is being created on. We will ad... | |
194298 | public function where($column, $operator = null, $value = null, $boolean = 'and')
{
if ($column instanceof ConditionExpression) {
$type = 'Expression';
$this->wheres[] = compact('type', 'column', 'boolean');
return $this;
}
// If the column is an array,... | |
194300 | public function orWhereNotIn($column, $values)
{
return $this->whereNotIn($column, $values, 'or');
}
/**
* Add a "where in raw" clause for integer values to the query.
*
* @param string $column
* @param \Illuminate\Contracts\Support\Arrayable|array $values
* @param str... | |
194301 | public function whereDate($column, $operator, $value = null, $boolean = 'and')
{
[$value, $operator] = $this->prepareValueAndOperator(
$value, $operator, func_num_args() === 2
);
// If the given operator is not found in the list of valid operators we will
// assume that ... | |
194302 | /**
* Add an "or where year" statement to the query.
*
* @param \Illuminate\Contracts\Database\Query\Expression|string $column
* @param \DateTimeInterface|string|int|null $operator
* @param \DateTimeInterface|string|int|null $value
* @return $this
*/
public function orWhereY... | |
194304 | /**
* Add a "where fulltext" clause to the query.
*
* @param string|string[] $columns
* @param string $value
* @param string $boolean
* @return $this
*/
public function whereFullText($columns, $value, array $options = [], $boolean = 'and')
{
$type = 'Fulltext';
... | |
194307 | /**
* Execute the query as a "select" statement.
*
* @param array|string $columns
* @return \Illuminate\Support\Collection
*/
public function get($columns = ['*'])
{
$items = collect($this->onceWithColumns(Arr::wrap($columns), function () {
return $this->processor-... | |
194321 | class Grammar extends BaseGrammar
{
use CompilesJsonPaths;
/**
* The grammar specific operators.
*
* @var array
*/
protected $operators = [];
/**
* The grammar specific bitwise operators.
*
* @var array
*/
protected $bitwiseOperators = [];
/**
* Th... | |
194345 | protected function paginator($items, $total, $perPage, $currentPage, $options)
{
return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact(
'items', 'total', 'perPage', 'currentPage', 'options'
));
}
/**
* Create a new simple paginator instance.
*
... | |
194354 | #[AsCommand(name: 'model:show')]
class ShowModelCommand extends DatabaseInspectionCommand
{
/**
* The console command name.
*
* @var string
*/
protected $name = 'model:show {model}';
/**
* The console command description.
*
* @var string
*/
protected $description... | |
194360 | <?php
namespace Illuminate\Database\Console\Migrations;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Contracts\Console\Isolatable;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Events\SchemaLoaded;
use Illuminate\Database\Migrations\Migrator;
use Illuminate\Database\SQLiteDatabaseDoes... | |
194394 | /**
* Load a set of relationships onto the mixed relationship collection.
*
* @param string $relation
* @param array $relations
* @return $this
*/
public function loadMorph($relation, $relations)
{
$this->getCollection()->loadMorph($relation, $relations);
retur... | |
194429 | /**
* Retrieve the authenticated user using the configured guard (if any).
*
* @param \Illuminate\Http\Request $request
* @param string $channel
* @return mixed
*/
protected function retrieveUser($request, $channel)
{
$options = $this->retrieveChannelOptions($channel);
... | |
194456 | <?php
namespace Illuminate\Cache;
use Exception;
use Illuminate\Contracts\Cache\LockProvider;
use Illuminate\Contracts\Cache\Store;
use Illuminate\Contracts\Filesystem\LockTimeoutException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Filesystem\LockableFile;
use Illuminate\Support\InteractsWithTime;
class F... | |
194503 | <?php
namespace Illuminate\Translation;
use Closure;
use Illuminate\Contracts\Translation\Loader;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use Illuminate\Support\Arr;
use Illuminate\Support\NamespacedItemResolver;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\Macroable;
use I... | |
194512 | <?php
namespace Illuminate\Config;
use ArrayAccess;
use Illuminate\Contracts\Config\Repository as ConfigContract;
use Illuminate\Support\Arr;
use Illuminate\Support\Traits\Macroable;
use InvalidArgumentException;
class Repository implements ArrayAccess, ConfigContract
{
use Macroable;
/**
* All of the ... | |
194543 | <?php
namespace Illuminate\Auth;
use Illuminate\Auth\Notifications\VerifyEmail;
trait MustVerifyEmail
{
/**
* Determine if the user has verified their email address.
*
* @return bool
*/
public function hasVerifiedEmail()
{
return ! is_null($this->email_verified_at);
}
... | |
194551 | <?php
namespace Illuminate\Auth\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Route;
use Symfony\Component\HttpFoundation\Response;
class RedirectIfAuthenticated
{
/**
* The callback that should be used to generate the authenticatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.