mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-05-16 13:08:25 -04:00
ALPHA 3.0.2
This commit is contained in:
@@ -35,7 +35,7 @@ class Response
|
||||
/**
|
||||
* Get the string representation of the message.
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
|
||||
+8
-1
@@ -4,6 +4,7 @@ namespace Illuminate\Auth;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Contracts\Auth\UserProvider;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
|
||||
@@ -110,7 +111,13 @@ class DatabaseUserProvider implements UserProvider
|
||||
$query = $this->conn->table($this->table);
|
||||
|
||||
foreach ($credentials as $key => $value) {
|
||||
if (! Str::contains($key, 'password')) {
|
||||
if (Str::contains($key, 'password')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($value) || $value instanceof Arrayable) {
|
||||
$query->whereIn($key, $value);
|
||||
} else {
|
||||
$query->where($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -4,6 +4,7 @@ namespace Illuminate\Auth;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Contracts\Auth\UserProvider;
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as UserContract;
|
||||
|
||||
@@ -113,7 +114,13 @@ class EloquentUserProvider implements UserProvider
|
||||
$query = $this->createModel()->newQuery();
|
||||
|
||||
foreach ($credentials as $key => $value) {
|
||||
if (! Str::contains($key, 'password')) {
|
||||
if (Str::contains($key, 'password')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_array($value) || $value instanceof Arrayable) {
|
||||
$query->whereIn($key, $value);
|
||||
} else {
|
||||
$query->where($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
+1
-1
@@ -84,7 +84,7 @@ class PusherBroadcaster extends Broadcaster
|
||||
*/
|
||||
protected function decodePusherResponse($request, $response)
|
||||
{
|
||||
if (! $request->callback) {
|
||||
if (! $request->input('callback', false)) {
|
||||
return json_decode($response, true);
|
||||
}
|
||||
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
+1
-1
@@ -929,7 +929,7 @@ class Connection implements ConnectionInterface
|
||||
return $this->getPdo();
|
||||
}
|
||||
|
||||
if ($this->getConfig('sticky') && $this->recordsModified) {
|
||||
if ($this->recordsModified && $this->getConfig('sticky')) {
|
||||
return $this->getPdo();
|
||||
}
|
||||
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
+24
-3
@@ -35,9 +35,15 @@ class FreshCommand extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
$this->dropAllTables(
|
||||
$database = $this->input->getOption('database')
|
||||
);
|
||||
$database = $this->input->getOption('database');
|
||||
|
||||
if ($this->option('drop-views')) {
|
||||
$this->dropAllViews($database);
|
||||
|
||||
$this->info('Dropped all views successfully.');
|
||||
}
|
||||
|
||||
$this->dropAllTables($database);
|
||||
|
||||
$this->info('Dropped all tables successfully.');
|
||||
|
||||
@@ -65,6 +71,19 @@ class FreshCommand extends Command
|
||||
->dropAllTables();
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop all of the database views.
|
||||
*
|
||||
* @param string $database
|
||||
* @return void
|
||||
*/
|
||||
protected function dropAllViews($database)
|
||||
{
|
||||
$this->laravel['db']->connection($database)
|
||||
->getSchemaBuilder()
|
||||
->dropAllViews();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the developer has requested database seeding.
|
||||
*
|
||||
@@ -100,6 +119,8 @@ class FreshCommand extends Command
|
||||
return [
|
||||
['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],
|
||||
|
||||
['drop-views', null, InputOption::VALUE_NONE, 'Drop all tables and views.'],
|
||||
|
||||
['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],
|
||||
|
||||
['path', null, InputOption::VALUE_OPTIONAL, 'The path to the migrations files to be executed.'],
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
@@ -124,6 +124,13 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
|
||||
*/
|
||||
protected static $globalScopes = [];
|
||||
|
||||
/**
|
||||
* The list of models classes that should not be affected with touch.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $ignoreOnTouch = [];
|
||||
|
||||
/**
|
||||
* The name of the "created at" column.
|
||||
*
|
||||
@@ -215,6 +222,54 @@ abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializab
|
||||
static::$globalScopes = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables relationship model touching for the current class during given callback scope.
|
||||
*
|
||||
* @param callable $callback
|
||||
* @return void
|
||||
*/
|
||||
public static function withoutTouching(callable $callback)
|
||||
{
|
||||
static::withoutTouchingOn([static::class], $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables relationship model touching for the given model classes during given callback scope.
|
||||
*
|
||||
* @param array $models
|
||||
* @param callable $callback
|
||||
* @return void
|
||||
*/
|
||||
public static function withoutTouchingOn(array $models, callable $callback)
|
||||
{
|
||||
static::$ignoreOnTouch = array_values(array_merge(static::$ignoreOnTouch, $models));
|
||||
|
||||
try {
|
||||
call_user_func($callback);
|
||||
} finally {
|
||||
static::$ignoreOnTouch = array_values(array_diff(static::$ignoreOnTouch, $models));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the given model is ignoring touches.
|
||||
*
|
||||
* @param string|null $class
|
||||
* @return bool
|
||||
*/
|
||||
public static function isIgnoringTouch($class = null)
|
||||
{
|
||||
$class = $class ?: static::class;
|
||||
|
||||
foreach (static::$ignoreOnTouch as $ignoredClass) {
|
||||
if ($class === $ignoredClass || is_subclass_of($class, $ignoredClass)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill the model with an array of attributes.
|
||||
*
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
+6
-2
@@ -161,9 +161,13 @@ abstract class Relation
|
||||
*/
|
||||
public function touch()
|
||||
{
|
||||
$column = $this->getRelated()->getUpdatedAtColumn();
|
||||
$model = $this->getRelated();
|
||||
|
||||
$this->rawUpdate([$column => $this->getRelated()->freshTimestampString()]);
|
||||
if (! $model::isIgnoringTouch()) {
|
||||
$this->rawUpdate([
|
||||
$model->getUpdatedAtColumn() => $model->freshTimestampString(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
+4
-3
@@ -61,7 +61,7 @@ class MigrationCreator
|
||||
// Next, we will fire any hooks that are supposed to fire after a migration is
|
||||
// created. Once that is done we'll be ready to return the full path to the
|
||||
// migration file so it can be used however it's needed by the developer.
|
||||
$this->firePostCreateHooks();
|
||||
$this->firePostCreateHooks($table);
|
||||
|
||||
return $path;
|
||||
}
|
||||
@@ -150,12 +150,13 @@ class MigrationCreator
|
||||
/**
|
||||
* Fire the registered post create hooks.
|
||||
*
|
||||
* @param string $table
|
||||
* @return void
|
||||
*/
|
||||
protected function firePostCreateHooks()
|
||||
protected function firePostCreateHooks($table)
|
||||
{
|
||||
foreach ($this->postCreate as $callback) {
|
||||
call_user_func($callback);
|
||||
call_user_func($callback, $table);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Vendored
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user