*
* @param array $lastErrors
*
* @return void
*/
private static function setLastErrors(array $lastErrors)
{
static::$lastErrors = $lastErrors;
}
/**
if (isset($locale)) {
setlocale(LC_NUMERIC, $locale);
}
static::setLastErrors(parent::getLastErrors());
}
/**
* Get timezone from a datetime instance.
*
*
* @return static
*/
public static function now($tz = null)
{
return new static(null, $tz);
}
/**
* Create a Carbon instance for today.
*
$dateClass = static::$dateClass ?: $defaultClassName;
// Check if date can be created using public class method...
if (method_exists($dateClass, $method) ||
method_exists($dateClass, 'hasMacro') && $dateClass::hasMacro($method)) {
return $dateClass::$method(...$parameters);
}
// If that fails, create the date with the default class...
$date = $defaultClassName::$method(...$parameters);
if (! $instance) {
throw new RuntimeException('A facade root has not been set.');
}
return $instance->$method(...$args);
}
}
* @param \DateTimeZone|string|null $tz
* @return \Illuminate\Support\Carbon
*/
function now($tz = null)
{
return Date::now($tz);
}
}
if (! function_exists('old')) {
/**
*
* @return Carbon
*/
protected function expires()
{
return now()->subSeconds($this->expires);
}
/**
* Return a random string for an activation code.
*
/**
* {@inheritDoc}
*/
public function removeExpired()
{
$expires = $this->expires();
return $this
->model
->newQuery()
->where('completed', false)
*/
protected function sweep($repository, array $lottery)
{
if ($this->configHitsLottery($lottery)) {
try {
$repository->removeExpired();
} catch (Exception $exception) {
info($exception->getMessage());
}
}
}
*/
protected function garbageCollect()
{
$config = $this->app->make('config')->get('core.acl.general');
$this->sweep($this->app->make(ActivationInterface::class), $config['activations']['lottery']);
}
/**
* Sweep expired codes.
*
->loadAndPublishTranslations()
->publishAssets()
->loadRoutes(['web'])
->loadMigrations();
$this->garbageCollect();
Event::listen(RouteMatched::class, function () {
dashboard_menu()
->registerItem([
'id' => 'cms-core-role-permission',
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
* Call a string reference to a class using Class@method syntax.
* @param mixed $value
* @return mixed
*/
public static function unwrapIfClosure($value)
{
return $value instanceof Closure ? $value() : $value;
}
/**
* Get the class name of the given parameter's type, if possible.
*
if ($container->hasMethodBinding($method)) {
return $container->callMethodBinding($method, $callback[0]);
}
return Util::unwrapIfClosure($default);
}
/**
* Normalize the given callback into a Class@method string.
*
if (static::isCallableWithAtSign($callback) || $defaultMethod) {
return static::callClass($container, $callback, $parameters, $defaultMethod);
}
return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) {
return $callback(...array_values(static::getMethodDependencies($container, $callback, $parameters)));
});
}
/**
*
* @throws \InvalidArgumentException
*/
public function call($callback, array $parameters = [], $defaultMethod = null)
{
return BoundMethod::call($this, $callback, $parameters, $defaultMethod);
}
/**
* Get a closure to resolve the given type from the container.
*
protected function bootProvider(ServiceProvider $provider)
{
$provider->callBootingCallbacks();
if (method_exists($provider, 'boot')) {
$this->call([$provider, 'boot']);
}
$provider->callBootedCallbacks();
}
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
$this->fireAppCallbacks($this->bootedCallbacks);
// Once the application has booted we will also fire some "booted" callbacks
// for any listeners that need to do work after this initial booting gets
// finished. This is useful when ordering the boot-up processes we run.
$this->fireAppCallbacks($this->bootingCallbacks);
array_walk($this->serviceProviders, function ($p) {
$this->bootProvider($p);
});
$this->booted = true;
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$app->boot();
}
}
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
public function handle($request)
{
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
return __DIR__;
});
$kernel = $app->make(Kernel::class);
$response = tap($kernel->handle(
$request = Request::capture()
))->send();
$kernel->terminate($request, $response);
TypeError
|
---|
TypeError: Carbon\Carbon::setLastErrors(): Argument #1 ($lastErrors) must be of type array, bool given, called in /home/drabyast/durbar.com.np/durbar/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php on line 98 at /home/drabyast/durbar.com.np/durbar/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:928 at Carbon\Carbon::setLastErrors() (/home/drabyast/durbar.com.np/durbar/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:98) at Carbon\Carbon->__construct() (/home/drabyast/durbar.com.np/durbar/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:252) at Carbon\Carbon::now() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Support/DateFactory.php:217) at Illuminate\Support\DateFactory->__call() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261) at Illuminate\Support\Facades\Facade::__callStatic() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:550) at now() (/home/drabyast/durbar.com.np/durbar/vendor/cyberros/platform/acl/src/Repositories/Eloquent/ActivationRepository.php:163) at Cyberros\ACL\Repositories\Eloquent\ActivationRepository->expires() (/home/drabyast/durbar.com.np/durbar/vendor/cyberros/platform/acl/src/Repositories/Eloquent/ActivationRepository.php:146) at Cyberros\ACL\Repositories\Eloquent\ActivationRepository->removeExpired() (/home/drabyast/durbar.com.np/durbar/vendor/cyberros/platform/acl/src/Providers/AclServiceProvider.php:127) at Cyberros\ACL\Providers\AclServiceProvider->sweep() (/home/drabyast/durbar.com.np/durbar/vendor/cyberros/platform/acl/src/Providers/AclServiceProvider.php:113) at Cyberros\ACL\Providers\AclServiceProvider->garbageCollect() (/home/drabyast/durbar.com.np/durbar/vendor/cyberros/platform/acl/src/Providers/AclServiceProvider.php:70) at Cyberros\ACL\Providers\AclServiceProvider->boot() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Container/Util.php:40) at Illuminate\Container\Util::unwrapIfClosure() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35) at Illuminate\Container\BoundMethod::call() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Container/Container.php:653) at Illuminate\Container\Container->call() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:924) at Illuminate\Foundation\Application->bootProvider() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:905) at Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() at array_walk() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:904) at Illuminate\Foundation\Application->boot() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17) at Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:237) at Illuminate\Foundation\Application->bootstrapWith() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:153) at Illuminate\Foundation\Http\Kernel->bootstrap() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:137) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() (/home/drabyast/durbar.com.np/durbar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:111) at Illuminate\Foundation\Http\Kernel->handle() (/home/drabyast/durbar.com.np/index.php:55) |