use BookStack\Model;
use BookStack\Traits\HasCreatorAndUpdater;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\MorphTo;
/**
*/
class Comment extends Model
{
+ use HasFactory;
use HasCreatorAndUpdater;
protected $fillable = ['text', 'parent_id'];
namespace BookStack\Actions;
use BookStack\Model;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\MorphTo;
class Tag extends Model
{
+ use HasFactory;
+
protected $fillable = ['name', 'value', 'order'];
protected $hidden = ['id', 'entity_id', 'entity_type', 'created_at', 'updated_at'];
use BookStack\Interfaces\Loggable;
use BookStack\Model;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class Role extends Model implements Loggable
{
+ use HasFactory;
+
protected $fillable = ['display_name', 'description', 'external_auth_id'];
/**
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class User extends Model implements AuthenticatableContract, CanResetPasswordContract, Loggable, Sluggable
{
+ use HasFactory;
use Authenticatable;
use CanResetPassword;
use Notifiable;
// Class aliases, Registered on application start
'aliases' => [
-
// Laravel
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
+ 'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
+ 'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
- 'Input' => Illuminate\Support\Facades\Input::class,
- 'Inspiring' => Illuminate\Foundation\Inspiring::class,
+ 'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
+ 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
- 'Redis' => Illuminate\Support\Facades\Redis::class,
+ // 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
+
+ // Laravel Packages
'Socialite' => Laravel\Socialite\Facades\Socialite::class,
// Third Party
return [
- // Method of authentication to use
// Options: standard, ldap, saml2, oidc
'method' => env('AUTH_METHOD', 'standard'),
'provider' => 'external',
],
'api' => [
- 'driver' => 'api-token',
+ 'driver' => 'api-token',
],
],
'driver' => 'eloquent',
'model' => \BookStack\Auth\User::class,
],
+
'external' => [
'driver' => 'external-users',
'model' => \BookStack\Auth\User::class,
],
+
+ // 'users' => [
+ // 'driver' => 'database',
+ // 'table' => 'users',
+ // ],
],
// Resetting Passwords
],
],
+ // Password Confirmation Timeout
+ // Here you may define the amount of seconds before a password confirmation
+ // times out and the user is prompted to re-enter their password via the
+ // confirmation screen. By default, the timeout lasts for three hours.
+ 'password_timeout' => 10800,
+
];
<?php
/**
- * Broadcasting configuration options.
+ * Caching configuration options.
*
* Changes to these config files are not supported by BookStack and may break upon updates.
* Configuration should be altered via the `.env` file or environment variables.
* Do not edit this file unless you're happy to maintain any changes yourself.
*/
+// MEMCACHED - Split out configuration into an array
+if (env('CACHE_DRIVER') === 'memcached') {
+ $memcachedServerKeys = ['host', 'port', 'weight'];
+ $memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
+ foreach ($memcachedServers as $index => $memcachedServer) {
+ $memcachedServerDetails = explode(':', $memcachedServer);
+ if (count($memcachedServerDetails) < 2) {
+ $memcachedServerDetails[] = '11211';
+ }
+ if (count($memcachedServerDetails) < 3) {
+ $memcachedServerDetails[] = '100';
+ }
+ $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
+ }
+}
+
return [
- // Default Broadcaster
- // This option controls the default broadcaster that will be used by the
- // framework when an event needs to be broadcast. This can be set to
- // any of the connections defined in the "connections" array below.
- 'default' => env('BROADCAST_DRIVER', 'pusher'),
-
- // Broadcast Connections
- // Here you may define all of the broadcast connections that will be used
- // to broadcast events to other systems or over websockets. Samples of
- // each available type of connection are provided inside this array.
- 'connections' => [
-
- 'pusher' => [
- 'driver' => 'pusher',
- 'key' => env('PUSHER_APP_KEY'),
- 'secret' => env('PUSHER_APP_SECRET'),
- 'app_id' => env('PUSHER_APP_ID'),
- 'options' => [
- 'cluster' => env('PUSHER_APP_CLUSTER'),
- 'useTLS' => true,
- ],
+ // Default cache store to use
+ // Can be overridden at cache call-time
+ 'default' => env('CACHE_DRIVER', 'file'),
+
+ // Available caches stores
+ 'stores' => [
+
+ 'apc' => [
+ 'driver' => 'apc',
],
- 'redis' => [
- 'driver' => 'redis',
- 'connection' => 'default',
+ 'array' => [
+ 'driver' => 'array',
+ 'serialize' => false,
+ ],
+
+ 'database' => [
+ 'driver' => 'database',
+ 'table' => 'cache',
+ 'connection' => null,
+ 'lock_connection' => null,
],
- 'log' => [
- 'driver' => 'log',
+ 'file' => [
+ 'driver' => 'file',
+ 'path' => storage_path('framework/cache'),
],
- 'null' => [
- 'driver' => 'null',
+ 'memcached' => [
+ 'driver' => 'memcached',
+ 'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [],
+ 'options' => [],
+ ],
+
+ 'redis' => [
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'lock_connection' => 'default',
+ ],
+
+ 'octane' => [
+ 'driver' => 'octane',
],
],
+ // Cache key prefix
+ // Used to prevent collisions in shared cache systems.
+ 'prefix' => env('CACHE_PREFIX', 'bookstack_cache'),
+
];
<?php
-/**
- * Caching configuration options.
- *
- * Changes to these config files are not supported by BookStack and may break upon updates.
- * Configuration should be altered via the `.env` file or environment variables.
- * Do not edit this file unless you're happy to maintain any changes yourself.
- */
-
-// MEMCACHED - Split out configuration into an array
-if (env('CACHE_DRIVER') === 'memcached') {
- $memcachedServerKeys = ['host', 'port', 'weight'];
- $memcachedServers = explode(',', trim(env('MEMCACHED_SERVERS', '127.0.0.1:11211:100'), ','));
- foreach ($memcachedServers as $index => $memcachedServer) {
- $memcachedServerDetails = explode(':', $memcachedServer);
- if (count($memcachedServerDetails) < 2) {
- $memcachedServerDetails[] = '11211';
- }
- if (count($memcachedServerDetails) < 3) {
- $memcachedServerDetails[] = '100';
- }
- $memcachedServers[$index] = array_combine($memcachedServerKeys, $memcachedServerDetails);
- }
-}
+use Illuminate\Support\Str;
return [
- // Default cache store to use
- // Can be overridden at cache call-time
+ /*
+ |--------------------------------------------------------------------------
+ | Default Cache Store
+ |--------------------------------------------------------------------------
+ |
+ | This option controls the default cache connection that gets used while
+ | using this caching library. This connection is used when another is
+ | not explicitly specified when executing a given caching function.
+ |
+ */
+
'default' => env('CACHE_DRIVER', 'file'),
- // Available caches stores
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Stores
+ |--------------------------------------------------------------------------
+ |
+ | Here you may define all of the cache "stores" for your application as
+ | well as their drivers. You may even define multiple stores for the
+ | same cache driver to group types of items stored in your caches.
+ |
+ | Supported drivers: "apc", "array", "database", "file",
+ | "memcached", "redis", "dynamodb", "octane", "null"
+ |
+ */
+
'stores' => [
'apc' => [
],
'array' => [
- 'driver' => 'array',
+ 'driver' => 'array',
+ 'serialize' => false,
],
'database' => [
- 'driver' => 'database',
- 'table' => 'cache',
- 'connection' => null,
+ 'driver' => 'database',
+ 'table' => 'cache',
+ 'connection' => null,
+ 'lock_connection' => null,
],
'file' => [
],
'memcached' => [
- 'driver' => 'memcached',
+ 'driver' => 'memcached',
+ 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
+ 'sasl' => [
+ env('MEMCACHED_USERNAME'),
+ env('MEMCACHED_PASSWORD'),
+ ],
+ 'options' => [
+ // Memcached::OPT_CONNECT_TIMEOUT => 2000,
+ ],
'servers' => env('CACHE_DRIVER') === 'memcached' ? $memcachedServers : [],
],
'redis' => [
- 'driver' => 'redis',
- 'connection' => 'default',
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'lock_connection' => 'default',
+ ],
+
+ 'dynamodb' => [
+ 'driver' => 'dynamodb',
+ 'key' => env('AWS_ACCESS_KEY_ID'),
+ 'secret' => env('AWS_SECRET_ACCESS_KEY'),
+ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
+ 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
+ 'endpoint' => env('DYNAMODB_ENDPOINT'),
+ ],
+
+ 'octane' => [
+ 'driver' => 'octane',
],
],
- // Cache key prefix
- // Used to prevent collisions in shared cache systems.
- 'prefix' => env('CACHE_PREFIX', 'bookstack_cache'),
+ /*
+ |--------------------------------------------------------------------------
+ | Cache Key Prefix
+ |--------------------------------------------------------------------------
+ |
+ | When utilizing a RAM based store such as APC or Memcached, there might
+ | be other applications utilizing the same cache. So, we'll specify a
+ | value to get prefixed to all our keys so we can avoid collisions.
+ |
+ */
+
+ 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
];
// file storage service, such as s3, to store publicly accessible assets.
'url' => env('STORAGE_URL', false),
- // Default Cloud Filesystem Disk
- 'cloud' => 's3',
-
// Available filesystem disks
// Only local, local_secure & s3 are supported by BookStack
'disks' => [
'local' => [
'driver' => 'local',
'root' => public_path(),
+ 'visibility' => 'public',
],
'local_secure_attachments' => [
'local_secure_images' => [
'driver' => 'local',
'root' => storage_path('uploads/images/'),
+ 'visibility' => 'public',
],
's3' => [
],
+ // Symbolic Links
+ // Here you may configure the symbolic links that will be created when the
+ // `storage:link` Artisan command is executed. The array keys should be
+ // the locations of the links and the values should be their targets.
+ 'links' => [
+ public_path('storage') => storage_path('app/public'),
+ ],
+
];
'days' => 7,
],
- 'slack' => [
- 'driver' => 'slack',
- 'url' => env('LOG_SLACK_WEBHOOK_URL'),
- 'username' => 'Laravel Log',
- 'emoji' => ':boom:',
- 'level' => 'critical',
- ],
-
'stderr' => [
'driver' => 'monolog',
+ 'level' => 'debug',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stderr',
'testing' => [
'driver' => 'testing',
],
+
+ 'emergency' => [
+ 'path' => storage_path('logs/laravel.log'),
+ ],
],
// Failed Login Message
],
'database' => [
- 'driver' => 'database',
- 'table' => 'jobs',
- 'queue' => 'default',
- 'retry_after' => 90,
+ 'driver' => 'database',
+ 'table' => 'jobs',
+ 'queue' => 'default',
+ 'retry_after' => 90,
+ 'after_commit' => false,
],
'redis' => [
- 'driver' => 'redis',
- 'connection' => 'default',
- 'queue' => env('REDIS_QUEUE', 'default'),
- 'retry_after' => 90,
- 'block_for' => null,
+ 'driver' => 'redis',
+ 'connection' => 'default',
+ 'queue' => env('REDIS_QUEUE', 'default'),
+ 'retry_after' => 90,
+ 'block_for' => null,
+ 'after_commit' => false,
],
],
// Failed queue job logging
'failed' => [
- 'database' => 'mysql', 'table' => 'failed_jobs',
+ 'driver' => 'database-uuids',
+ 'database' => 'mysql',
+ 'table' => 'failed_jobs',
],
];
use BookStack\Uploads\Image;
use Exception;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
*/
class Book extends Entity implements HasCoverImage
{
+ use HasFactory;
+
public $searchFactor = 2;
protected $fillable = ['name', 'description'];
namespace BookStack\Entities\Models;
use BookStack\Uploads\Image;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Bookshelf extends Entity implements HasCoverImage
{
+ use HasFactory;
+
protected $table = 'bookshelves';
public $searchFactor = 3;
namespace BookStack\Entities\Models;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Support\Collection;
/**
*/
class Chapter extends BookChild
{
+ use HasFactory;
+
public $searchFactor = 1.3;
protected $fillable = ['name', 'description', 'priority', 'book_id'];
use BookStack\Uploads\Attachment;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Permissions;
*/
class Page extends BookChild
{
+ use HasFactory;
+
public static $listAttributes = ['name', 'id', 'slug', 'book_id', 'chapter_id', 'draft', 'template', 'text', 'created_at', 'updated_at', 'priority'];
public static $contentAttributes = ['name', 'id', 'slug', 'book_id', 'chapter_id', 'draft', 'template', 'html', 'text', 'created_at', 'updated_at', 'priority'];
* @var array
*/
protected $dontFlash = [
+ 'current_password',
'password',
'password_confirmation',
];
* These middleware are run during every request to your application.
*/
protected $middleware = [
- \BookStack\Http\Middleware\CheckForMaintenanceMode::class,
+ \BookStack\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\BookStack\Http\Middleware\TrimStrings::class,
\BookStack\Http\Middleware\TrustProxies::class,
namespace BookStack\Http\Middleware;
-use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
+use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
-class CheckForMaintenanceMode extends Middleware
+class PreventRequestsDuringMaintenance extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
namespace BookStack\Http\Middleware;
+use BookStack\Providers\RouteServiceProvider;
use Closure;
-use Illuminate\Contracts\Auth\Guard;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
- /**
- * The Guard implementation.
- *
- * @var Guard
- */
- protected $auth;
-
- /**
- * Create a new filter instance.
- *
- * @param Guard $auth
- *
- * @return void
- */
- public function __construct(Guard $auth)
- {
- $this->auth = $auth;
- }
-
/**
* Handle an incoming request.
*
- * @param \Illuminate\Http\Request $request
- * @param \Closure $next
- *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @param string|null ...$guards
* @return mixed
*/
- public function handle($request, Closure $next)
+ public function handle(Request $request, Closure $next, ...$guards)
{
- $requireConfirmation = setting('registration-confirmation');
- if ($this->auth->check() && (!$requireConfirmation || ($requireConfirmation && $this->auth->user()->email_confirmed))) {
- return redirect('/');
+ $guards = empty($guards) ? [null] : $guards;
+
+ foreach ($guards as $guard) {
+ if (Auth::guard($guard)->check()) {
+ return redirect(RouteServiceProvider::HOME);
+ }
}
return $next($request);
}
-}
+}
\ No newline at end of file
<?php
-namespace App\Http\Middleware;
+namespace BookStack\Http\Middleware;
use Illuminate\Http\Middleware\TrustHosts as Middleware;
namespace BookStack\Http\Middleware;
use Closure;
-use Fideloper\Proxy\TrustProxies as Middleware;
+use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
*
* @var int
*/
- protected $headers = Request::HEADER_X_FORWARDED_ALL;
+ protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB;
/**
* Handle the request, Set the correct user-configured proxy information.
use GuzzleHttp\Client;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Database\Eloquent\Relations\Relation;
+use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\URL;
// View Composers
View::composer('entities.breadcrumbs', BreadcrumbsViewComposer::class);
+
+ // Set paginator to use bootstrap-style pagination
+ Paginator::useBootstrap();
}
/**
*/
public function boot()
{
- parent::boot();
}
}
namespace BookStack\Providers;
+use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
+ /**
+ * The path to the "home" route for your application.
+ *
+ * This is used by Laravel authentication to redirect users after login.
+ *
+ * @var string
+ */
+ public const HOME = '/';
+
/**
* This namespace is applied to the controller routes in your routes file.
*
*
* @var string
*/
- protected $namespace = 'BookStack\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*/
public function boot()
{
- parent::boot();
- }
+ $this->configureRateLimiting();
- /**
- * Define the routes for the application.
- *
- * @return void
- */
- public function map()
- {
- $this->mapWebRoutes();
- $this->mapApiRoutes();
+ $this->routes(function () {
+ $this->mapWebRoutes();
+ $this->mapApiRoutes();
+ });
}
/**
require base_path('routes/api.php');
});
}
+
+ /**
+ * Configure the rate limiters for the application.
+ *
+ * @return void
+ */
+ protected function configureRateLimiting()
+ {
+ RateLimiter::for('api', function (Request $request) {
+ return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
+ });
+ }
}
use BookStack\Entities\Models\Page;
use BookStack\Model;
use BookStack\Traits\HasCreatorAndUpdater;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
/**
* @property int $id
*/
class Image extends Model
{
+ use HasFactory;
use HasCreatorAndUpdater;
protected $fillable = ['name'];
"barryvdh/laravel-dompdf": "^0.9.0",
"barryvdh/laravel-snappy": "^0.4.8",
"doctrine/dbal": "^3.1",
- "fideloper/proxy": "^4.4.1",
"filp/whoops": "^2.14",
+ "guzzlehttp/guzzle": "^7.4",
"intervention/image": "^2.7",
- "laravel/framework": "^7.29",
+ "laravel/framework": "^8.68",
"laravel/socialite": "^5.2",
+ "laravel/tinker": "^2.5",
+ "laravel/ui": "^3.3",
"league/commonmark": "^1.5",
"league/flysystem-aws-s3-v3": "^1.0.29",
"league/html-to-markdown": "^5.0.0",
"onelogin/php-saml": "^4.0",
"phpseclib/phpseclib": "~3.0",
"pragmarx/google2fa": "^8.0",
- "predis/predis": "^1.1.6",
+ "predis/predis": "^1.1",
"socialiteproviders/discord": "^4.1",
"socialiteproviders/gitlab": "^4.1",
"socialiteproviders/microsoft-azure": "^4.1",
"socialiteproviders/okta": "^4.1",
"socialiteproviders/slack": "^4.1",
"socialiteproviders/twitch": "^5.3",
- "ssddanbrown/htmldiff": "^1.0.1",
- "laravel/ui": "^2.5",
- "guzzlehttp/guzzle": "^7.4.0",
- "laravel/tinker": "^2.5"
+ "ssddanbrown/htmldiff": "^1.0.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"fakerphp/faker": "^1.13.0",
- "mockery/mockery": "^1.3.3",
+ "mockery/mockery": "^1.4.2",
"phpunit/phpunit": "^9.5.3",
"symfony/dom-crawler": "^5.3",
- "nunomaduro/collision": "^4.3"
+ "nunomaduro/collision": "^5.0"
},
"autoload": {
- "classmap": [
- "database/seeds",
- "database/factories"
- ],
"psr-4": {
- "BookStack\\": "app/"
+ "BookStack\\": "app/",
+ "Database\\Factories\\": "database/factories/",
+ "Database\\Seeders\\": "database/seeders/"
},
"files": [
"app/helpers.php"
}
},
"scripts": {
+ "post-autoload-dump": [
+ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
+ "@php artisan package:discover --ansi"
+ ],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"@php artisan cache:clear",
"@php artisan view:clear"
],
- "post-autoload-dump": [
- "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
- "@php artisan package:discover --ansi"
- ],
"refresh-test-database": [
"@php artisan migrate:refresh --database=mysql_testing",
"@php artisan db:seed --class=DummyContentSeeder --database=mysql_testing"
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "491a3de7d49182613d0c81032a7001e1",
+ "content-hash": "9a5d92382b2955dd7de41de5fa9f86b5",
"packages": [
{
"name": "aws/aws-crt-php",
},
{
"name": "aws/aws-sdk-php",
- "version": "3.199.4",
+ "version": "3.199.7",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "047f6ce04b1de9320ca00bf393d6f03b9d036fa5"
+ "reference": "fda176884d2952cffc7e67209470bff49609339c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/047f6ce04b1de9320ca00bf393d6f03b9d036fa5",
- "reference": "047f6ce04b1de9320ca00bf393d6f03b9d036fa5",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fda176884d2952cffc7e67209470bff49609339c",
+ "reference": "fda176884d2952cffc7e67209470bff49609339c",
"shasum": ""
},
"require": {
"support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.199.4"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.199.7"
},
- "time": "2021-10-26T18:14:35+00:00"
+ "time": "2021-10-29T18:25:02+00:00"
},
{
"name": "bacon/bacon-qr-code",
},
{
"name": "dragonmantank/cron-expression",
- "version": "v2.3.1",
+ "version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/dragonmantank/cron-expression.git",
- "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2"
+ "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2",
- "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2",
+ "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c",
+ "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c",
"shasum": ""
},
"require": {
- "php": "^7.0|^8.0"
+ "php": "^7.2|^8.0",
+ "webmozart/assert": "^1.7.0"
+ },
+ "replace": {
+ "mtdowling/cron-expression": "^1.0"
},
"require-dev": {
- "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0"
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^0.12",
+ "phpstan/phpstan-webmozart-assert": "^0.12.7",
+ "phpunit/phpunit": "^7.0|^8.0|^9.0"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
"autoload": {
"psr-4": {
"Cron\\": "src/Cron/"
"MIT"
],
"authors": [
- {
- "name": "Michael Dowling",
- "homepage": "https://github.com/mtdowling"
- },
{
"name": "Chris Tankersley",
],
"support": {
"issues": "https://github.com/dragonmantank/cron-expression/issues",
- "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1"
+ "source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0"
},
"funding": [
{
"type": "github"
}
],
- "time": "2020-10-13T00:52:37+00:00"
+ "time": "2020-11-24T19:55:57+00:00"
},
{
"name": "egulias/email-validator",
],
"time": "2020-12-29T14:50:06+00:00"
},
- {
- "name": "fideloper/proxy",
- "version": "4.4.1",
- "source": {
- "type": "git",
- "url": "https://github.com/fideloper/TrustedProxy.git",
- "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/c073b2bd04d1c90e04dc1b787662b558dd65ade0",
- "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0",
- "shasum": ""
- },
- "require": {
- "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "illuminate/http": "^5.0|^6.0|^7.0|^8.0|^9.0",
- "mockery/mockery": "^1.0",
- "phpunit/phpunit": "^6.0"
- },
- "type": "library",
- "extra": {
- "laravel": {
- "providers": [
- "Fideloper\\Proxy\\TrustedProxyServiceProvider"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "Fideloper\\Proxy\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Chris Fidao",
- }
- ],
- "description": "Set trusted proxies for Laravel",
- "keywords": [
- "load balancing",
- "proxy",
- "trusted proxy"
- ],
- "support": {
- "issues": "https://github.com/fideloper/TrustedProxy/issues",
- "source": "https://github.com/fideloper/TrustedProxy/tree/4.4.1"
- },
- "time": "2020-10-22T13:48:01+00:00"
- },
{
"name": "filp/whoops",
"version": "2.14.4",
],
"time": "2021-10-03T12:00:00+00:00"
},
+ {
+ "name": "graham-campbell/result-type",
+ "version": "v1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/GrahamCampbell/Result-Type.git",
+ "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/296c015dc30ec4322168c5ad3ee5cc11dae827ac",
+ "reference": "296c015dc30ec4322168c5ad3ee5cc11dae827ac",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "phpoption/phpoption": "^1.8"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "GrahamCampbell\\ResultType\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Graham Campbell",
+ }
+ ],
+ "description": "An Implementation Of The Result Type",
+ "keywords": [
+ "Graham Campbell",
+ "GrahamCampbell",
+ "Result Type",
+ "Result-Type",
+ "result"
+ ],
+ "support": {
+ "issues": "https://github.com/GrahamCampbell/Result-Type/issues",
+ "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/GrahamCampbell",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2021-10-17T19:48:54+00:00"
+ },
{
"name": "guzzlehttp/guzzle",
"version": "7.4.0",
},
{
"name": "laravel/framework",
- "version": "v7.30.4",
+ "version": "v8.68.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
- "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3"
+ "reference": "abe985ff1fb82dd04aab03bc1dc56e83fe61a59f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/framework/zipball/9dd38140dc2924daa1a020a3d7a45f9ceff03df3",
- "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3",
+ "url": "https://api.github.com/repos/laravel/framework/zipball/abe985ff1fb82dd04aab03bc1dc56e83fe61a59f",
+ "reference": "abe985ff1fb82dd04aab03bc1dc56e83fe61a59f",
"shasum": ""
},
"require": {
"doctrine/inflector": "^1.4|^2.0",
- "dragonmantank/cron-expression": "^2.3.1",
+ "dragonmantank/cron-expression": "^3.0.2",
"egulias/email-validator": "^2.1.10",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
- "league/commonmark": "^1.3",
+ "laravel/serializable-closure": "^1.0",
+ "league/commonmark": "^1.3|^2.0.2",
"league/flysystem": "^1.1",
"monolog/monolog": "^2.0",
- "nesbot/carbon": "^2.31",
+ "nesbot/carbon": "^2.53.1",
"opis/closure": "^3.6",
- "php": "^7.2.5|^8.0",
+ "php": "^7.3|^8.0",
"psr/container": "^1.0",
+ "psr/log": "^1.0 || ^2.0",
"psr/simple-cache": "^1.0",
- "ramsey/uuid": "^3.7|^4.0",
- "swiftmailer/swiftmailer": "^6.0",
- "symfony/console": "^5.0",
- "symfony/error-handler": "^5.0",
- "symfony/finder": "^5.0",
- "symfony/http-foundation": "^5.0",
- "symfony/http-kernel": "^5.0",
- "symfony/mime": "^5.0",
- "symfony/polyfill-php73": "^1.17",
- "symfony/process": "^5.0",
- "symfony/routing": "^5.0",
- "symfony/var-dumper": "^5.0",
+ "ramsey/uuid": "^4.2.2",
+ "swiftmailer/swiftmailer": "^6.3",
+ "symfony/console": "^5.1.4",
+ "symfony/error-handler": "^5.1.4",
+ "symfony/finder": "^5.1.4",
+ "symfony/http-foundation": "^5.1.4",
+ "symfony/http-kernel": "^5.1.4",
+ "symfony/mime": "^5.1.4",
+ "symfony/process": "^5.1.4",
+ "symfony/routing": "^5.1.4",
+ "symfony/var-dumper": "^5.1.4",
"tijsverkoyen/css-to-inline-styles": "^2.2.2",
- "vlucas/phpdotenv": "^4.0",
+ "vlucas/phpdotenv": "^5.2",
"voku/portable-ascii": "^1.4.8"
},
"conflict": {
"tightenco/collect": "<5.5.33"
},
"provide": {
- "psr/container-implementation": "1.0"
+ "psr/container-implementation": "1.0",
+ "psr/simple-cache-implementation": "1.0"
},
"replace": {
"illuminate/auth": "self.version",
"illuminate/broadcasting": "self.version",
"illuminate/bus": "self.version",
"illuminate/cache": "self.version",
+ "illuminate/collections": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/container": "self.version",
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
"illuminate/log": "self.version",
+ "illuminate/macroable": "self.version",
"illuminate/mail": "self.version",
"illuminate/notifications": "self.version",
"illuminate/pagination": "self.version",
"illuminate/view": "self.version"
},
"require-dev": {
- "aws/aws-sdk-php": "^3.155",
- "doctrine/dbal": "^2.6",
- "filp/whoops": "^2.8",
- "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
+ "aws/aws-sdk-php": "^3.198.1",
+ "doctrine/dbal": "^2.13.3|^3.1.2",
+ "filp/whoops": "^2.14.3",
+ "guzzlehttp/guzzle": "^6.5.5|^7.0.1",
"league/flysystem-cached-adapter": "^1.0",
- "mockery/mockery": "~1.3.3|^1.4.2",
- "moontoast/math": "^1.1",
- "orchestra/testbench-core": "^5.8",
+ "mockery/mockery": "^1.4.4",
+ "orchestra/testbench-core": "^6.23",
"pda/pheanstalk": "^4.0",
- "phpunit/phpunit": "^8.4|^9.3.3",
- "predis/predis": "^1.1.1",
- "symfony/cache": "^5.0"
+ "phpunit/phpunit": "^8.5.19|^9.5.8",
+ "predis/predis": "^1.1.9",
+ "symfony/cache": "^5.1.4"
},
"suggest": {
- "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).",
- "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).",
+ "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).",
+ "brianium/paratest": "Required to run tests in parallel (^6.0).",
+ "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.2).",
+ "ext-bcmath": "Required to use the multiple_of validation rule.",
"ext-ftp": "Required to use the Flysystem FTP driver.",
"ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().",
"ext-memcached": "Required to use the memcache cache driver.",
"ext-posix": "Required to use all features of the queue worker.",
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
"fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).",
- "filp/whoops": "Required for friendly error pages in development (^2.8).",
- "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.3.1|^7.0.1).",
+ "filp/whoops": "Required for friendly error pages in development (^2.14.3).",
+ "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).",
"laravel/tinker": "Required to use the tinker console command (^2.0).",
"league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).",
"league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).",
"league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).",
- "mockery/mockery": "Required to use mocking (~1.3.3|^1.4.2).",
- "moontoast/math": "Required to use ordered UUIDs (^1.1).",
+ "mockery/mockery": "Required to use mocking (^1.4.4).",
"nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).",
"pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).",
- "phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.3.3).",
- "predis/predis": "Required to use the predis connector (^1.1.2).",
+ "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).",
+ "predis/predis": "Required to use the predis connector (^1.1.9).",
"psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).",
- "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).",
- "symfony/cache": "Required to PSR-6 cache bridge (^5.0).",
- "symfony/filesystem": "Required to create relative storage directory symbolic links (^5.0).",
+ "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0|^6.0).",
+ "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).",
+ "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).",
"symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).",
"wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "7.x-dev"
+ "dev-master": "8.x-dev"
}
},
"autoload": {
"files": [
+ "src/Illuminate/Collections/helpers.php",
+ "src/Illuminate/Events/functions.php",
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Support/helpers.php"
],
"psr-4": {
- "Illuminate\\": "src/Illuminate/"
+ "Illuminate\\": "src/Illuminate/",
+ "Illuminate\\Support\\": [
+ "src/Illuminate/Macroable/",
+ "src/Illuminate/Collections/"
+ ]
}
},
"notification-url": "https://packagist.org/downloads/",
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
- "time": "2021-01-21T14:10:48+00:00"
+ "time": "2021-10-27T12:31:46+00:00"
+ },
+ {
+ "name": "laravel/serializable-closure",
+ "version": "v1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/laravel/serializable-closure.git",
+ "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/6cfc678735f22ccedad761b8cae2bab14c3d8e5b",
+ "reference": "6cfc678735f22ccedad761b8cae2bab14c3d8e5b",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.3|^8.0"
+ },
+ "require-dev": {
+ "pestphp/pest": "^1.18",
+ "phpstan/phpstan": "^0.12.98",
+ "symfony/var-dumper": "^5.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Laravel\\SerializableClosure\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Taylor Otwell",
+ },
+ {
+ "name": "Nuno Maduro",
+ }
+ ],
+ "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.",
+ "keywords": [
+ "closure",
+ "laravel",
+ "serializable"
+ ],
+ "support": {
+ "issues": "https://github.com/laravel/serializable-closure/issues",
+ "source": "https://github.com/laravel/serializable-closure"
+ },
+ "time": "2021-10-07T14:00:57+00:00"
},
{
"name": "laravel/socialite",
},
{
"name": "laravel/ui",
- "version": "v2.5.0",
+ "version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/ui.git",
- "reference": "d01a705763c243b07be795e9d1bb47f89260f73d"
+ "reference": "07d725813350c695c779382cbd6dac0ab8665537"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/ui/zipball/d01a705763c243b07be795e9d1bb47f89260f73d",
- "reference": "d01a705763c243b07be795e9d1bb47f89260f73d",
+ "url": "https://api.github.com/repos/laravel/ui/zipball/07d725813350c695c779382cbd6dac0ab8665537",
+ "reference": "07d725813350c695c779382cbd6dac0ab8665537",
"shasum": ""
},
"require": {
- "illuminate/console": "^7.0",
- "illuminate/filesystem": "^7.0",
- "illuminate/support": "^7.0",
- "php": "^7.2.5|^8.0"
+ "illuminate/console": "^8.42",
+ "illuminate/filesystem": "^8.42",
+ "illuminate/support": "^8.42",
+ "illuminate/validation": "^8.42",
+ "php": "^7.3|^8.0"
},
"type": "library",
"extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ },
"laravel": {
"providers": [
"Laravel\\Ui\\UiServiceProvider"
"ui"
],
"support": {
- "issues": "https://github.com/laravel/ui/issues",
- "source": "https://github.com/laravel/ui/tree/v2.5.0"
+ "source": "https://github.com/laravel/ui/tree/v3.3.0"
},
- "time": "2020-11-03T19:45:19+00:00"
+ "time": "2021-05-25T16:45:33+00:00"
},
{
"name": "league/commonmark",
},
{
"name": "phpseclib/phpseclib",
- "version": "3.0.10",
+ "version": "3.0.11",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
- "reference": "62fcc5a94ac83b1506f52d7558d828617fac9187"
+ "reference": "6e794226a35159eb06f355efe59a0075a16551dd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/62fcc5a94ac83b1506f52d7558d828617fac9187",
- "reference": "62fcc5a94ac83b1506f52d7558d828617fac9187",
+ "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/6e794226a35159eb06f355efe59a0075a16551dd",
+ "reference": "6e794226a35159eb06f355efe59a0075a16551dd",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/phpseclib/phpseclib/issues",
- "source": "https://github.com/phpseclib/phpseclib/tree/3.0.10"
+ "source": "https://github.com/phpseclib/phpseclib/tree/3.0.11"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-08-16T04:24:45+00:00"
+ "time": "2021-10-27T03:01:46+00:00"
},
{
"name": "pragmarx/google2fa",
},
{
"name": "symfony/console",
- "version": "v5.3.7",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a"
+ "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a",
- "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a",
+ "url": "https://api.github.com/repos/symfony/console/zipball/d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
+ "reference": "d4e409d9fbcfbf71af0e5a940abb7b0b4bad0bd3",
"shasum": ""
},
"require": {
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.3.7"
+ "source": "https://github.com/symfony/console/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-08-25T20:02:16+00:00"
+ "time": "2021-10-26T09:30:15+00:00"
},
{
"name": "symfony/css-selector",
},
{
"name": "symfony/http-foundation",
- "version": "v5.3.7",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5"
+ "reference": "9f34f02e8a5fdc7a56bafe011cea1ce97300e54c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e36c8e5502b4f3f0190c675f1c1f1248a64f04e5",
- "reference": "e36c8e5502b4f3f0190c675f1c1f1248a64f04e5",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9f34f02e8a5fdc7a56bafe011cea1ce97300e54c",
+ "reference": "9f34f02e8a5fdc7a56bafe011cea1ce97300e54c",
"shasum": ""
},
"require": {
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-foundation/tree/v5.3.7"
+ "source": "https://github.com/symfony/http-foundation/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-08-27T11:20:35+00:00"
+ "time": "2021-10-11T15:41:55+00:00"
},
{
"name": "symfony/http-kernel",
- "version": "v5.3.9",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "ceaf46a992f60e90645e7279825a830f733a17c5"
+ "reference": "703e4079920468e9522b72cf47fd76ce8d795e86"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/ceaf46a992f60e90645e7279825a830f733a17c5",
- "reference": "ceaf46a992f60e90645e7279825a830f733a17c5",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/703e4079920468e9522b72cf47fd76ce8d795e86",
+ "reference": "703e4079920468e9522b72cf47fd76ce8d795e86",
"shasum": ""
},
"require": {
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/http-kernel/tree/v5.3.9"
+ "source": "https://github.com/symfony/http-kernel/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-09-28T10:25:11+00:00"
+ "time": "2021-10-29T08:36:48+00:00"
},
{
"name": "symfony/mime",
},
{
"name": "symfony/string",
- "version": "v5.3.7",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5"
+ "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5",
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5",
+ "url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
+ "reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
"shasum": ""
},
"require": {
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.3.7"
+ "source": "https://github.com/symfony/string/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-08-26T08:00:08+00:00"
+ "time": "2021-10-27T18:21:46+00:00"
},
{
"name": "symfony/translation",
- "version": "v5.3.9",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
- "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886"
+ "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/translation/zipball/6e69f3551c1a3356cf6ea8d019bf039a0f8b6886",
- "reference": "6e69f3551c1a3356cf6ea8d019bf039a0f8b6886",
+ "url": "https://api.github.com/repos/symfony/translation/zipball/6ef197aea2ac8b9cd63e0da7522b3771714035aa",
+ "reference": "6ef197aea2ac8b9cd63e0da7522b3771714035aa",
"shasum": ""
},
"require": {
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/translation/tree/v5.3.9"
+ "source": "https://github.com/symfony/translation/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-08-26T08:22:53+00:00"
+ "time": "2021-10-10T06:43:24+00:00"
},
{
"name": "symfony/translation-contracts",
},
{
"name": "symfony/var-dumper",
- "version": "v5.3.8",
+ "version": "v5.3.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
- "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da"
+ "reference": "875432adb5f5570fff21036fd22aee244636b7d1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eaaea4098be1c90c8285543e1356a09c8aa5c8da",
- "reference": "eaaea4098be1c90c8285543e1356a09c8aa5c8da",
+ "url": "https://api.github.com/repos/symfony/var-dumper/zipball/875432adb5f5570fff21036fd22aee244636b7d1",
+ "reference": "875432adb5f5570fff21036fd22aee244636b7d1",
"shasum": ""
},
"require": {
"dump"
],
"support": {
- "source": "https://github.com/symfony/var-dumper/tree/v5.3.8"
+ "source": "https://github.com/symfony/var-dumper/tree/v5.3.10"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-09-24T15:59:58+00:00"
+ "time": "2021-10-26T09:30:15+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
},
{
"name": "vlucas/phpdotenv",
- "version": "v4.2.1",
+ "version": "v5.3.1",
"source": {
"type": "git",
"url": "https://github.com/vlucas/phpdotenv.git",
- "reference": "d38f4d1edcbe32515a0ad593cbd4c858e337263c"
+ "reference": "accaddf133651d4b5cf81a119f25296736ffc850"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/d38f4d1edcbe32515a0ad593cbd4c858e337263c",
- "reference": "d38f4d1edcbe32515a0ad593cbd4c858e337263c",
+ "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/accaddf133651d4b5cf81a119f25296736ffc850",
+ "reference": "accaddf133651d4b5cf81a119f25296736ffc850",
"shasum": ""
},
"require": {
- "php": "^5.5.9 || ^7.0 || ^8.0",
- "phpoption/phpoption": "^1.7.3",
- "symfony/polyfill-ctype": "^1.17"
+ "ext-pcre": "*",
+ "graham-campbell/result-type": "^1.0.2",
+ "php": "^7.1.3 || ^8.0",
+ "phpoption/phpoption": "^1.8",
+ "symfony/polyfill-ctype": "^1.23",
+ "symfony/polyfill-mbstring": "^1.23.1",
+ "symfony/polyfill-php80": "^1.23.1"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4.1",
"ext-filter": "*",
- "ext-pcre": "*",
- "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.21"
+ "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10"
},
"suggest": {
- "ext-filter": "Required to use the boolean validator.",
- "ext-pcre": "Required to use most of the library."
+ "ext-filter": "Required to use the boolean validator."
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.2-dev"
+ "dev-master": "5.3-dev"
}
},
"autoload": {
],
"support": {
"issues": "https://github.com/vlucas/phpdotenv/issues",
- "source": "https://github.com/vlucas/phpdotenv/tree/v4.2.1"
+ "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.1"
},
"funding": [
{
"type": "tidelift"
}
],
- "time": "2021-10-02T19:17:08+00:00"
+ "time": "2021-10-02T19:24:42+00:00"
},
{
"name": "voku/portable-ascii",
}
],
"time": "2020-11-12T00:07:28+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozarts/assert.git",
+ "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
+ "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0",
+ "symfony/polyfill-ctype": "^1.8"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<0.12.20",
+ "vimeo/psalm": "<4.6.1 || 4.6.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8.5.13"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.10-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "support": {
+ "issues": "https://github.com/webmozarts/assert/issues",
+ "source": "https://github.com/webmozarts/assert/tree/1.10.0"
+ },
+ "time": "2021-03-09T10:59:23+00:00"
}
],
"packages-dev": [
},
{
"name": "nunomaduro/collision",
- "version": "v4.3.0",
+ "version": "v5.10.0",
"source": {
"type": "git",
"url": "https://github.com/nunomaduro/collision.git",
- "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e"
+ "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c125dc2463f3e144ddc7e05e63077109508c94e",
- "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e",
+ "url": "https://api.github.com/repos/nunomaduro/collision/zipball/3004cfa49c022183395eabc6d0e5207dfe498d00",
+ "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00",
"shasum": ""
},
"require": {
"facade/ignition-contracts": "^1.0",
- "filp/whoops": "^2.4",
- "php": "^7.2.5 || ^8.0",
+ "filp/whoops": "^2.14.3",
+ "php": "^7.3 || ^8.0",
"symfony/console": "^5.0"
},
"require-dev": {
- "facade/ignition": "^2.0",
- "fideloper/proxy": "^4.2",
- "friendsofphp/php-cs-fixer": "^2.16",
- "fruitcake/laravel-cors": "^1.0",
- "laravel/framework": "^7.0",
- "laravel/tinker": "^2.0",
- "nunomaduro/larastan": "^0.6",
- "orchestra/testbench": "^5.0",
- "phpstan/phpstan": "^0.12.3",
- "phpunit/phpunit": "^8.5.1 || ^9.0"
+ "brianium/paratest": "^6.1",
+ "fideloper/proxy": "^4.4.1",
+ "fruitcake/laravel-cors": "^2.0.3",
+ "laravel/framework": "8.x-dev",
+ "nunomaduro/larastan": "^0.6.2",
+ "nunomaduro/mock-final-classes": "^1.0",
+ "orchestra/testbench": "^6.0",
+ "phpstan/phpstan": "^0.12.64",
+ "phpunit/phpunit": "^9.5.0"
},
"type": "library",
"extra": {
"type": "patreon"
}
],
- "time": "2020-10-29T15:12:23+00:00"
+ "time": "2021-09-20T15:06:32+00:00"
},
{
"name": "phar-io/manifest",
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.2.7",
+ "version": "9.2.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
+ "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cf04e88a2e3c56fc1a65488afd493325b4c1bc3e",
+ "reference": "cf04e88a2e3c56fc1a65488afd493325b4c1bc3e",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.12.0",
+ "nikic/php-parser": "^4.13.0",
"php": ">=7.3",
"phpunit/php-file-iterator": "^3.0.3",
"phpunit/php-text-template": "^2.0.2",
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.8"
},
"funding": [
{
"type": "github"
}
],
- "time": "2021-09-17T05:39:03+00:00"
+ "time": "2021-10-30T08:01:38+00:00"
},
{
"name": "phpunit/php-file-iterator",
}
],
"time": "2021-07-28T10:34:58+00:00"
- },
- {
- "name": "webmozart/assert",
- "version": "1.10.0",
- "source": {
- "type": "git",
- "url": "https://github.com/webmozarts/assert.git",
- "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
- "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0",
- "symfony/polyfill-ctype": "^1.8"
- },
- "conflict": {
- "phpstan/phpstan": "<0.12.20",
- "vimeo/psalm": "<4.6.1 || 4.6.2"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.5.13"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.10-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Webmozart\\Assert\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Bernhard Schussek",
- }
- ],
- "description": "Assertions to validate method input/output with nice error messages.",
- "keywords": [
- "assert",
- "check",
- "validate"
- ],
- "support": {
- "issues": "https://github.com/webmozarts/assert/issues",
- "source": "https://github.com/webmozarts/assert/tree/1.10.0"
- },
- "time": "2021-03-09T10:59:23+00:00"
}
],
"aliases": [],
--- /dev/null
+<?php
+
+namespace Database\Factories\Actions;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class CommentFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Actions\Comment::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ $text = $this->faker->paragraph(1);
+ $html = '<p>' . $text . '</p>';
+
+ return [
+ 'html' => $html,
+ 'text' => $text,
+ 'parent_id' => null,
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Actions;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class TagFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Actions\Tag::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->city,
+ 'value' => $this->faker->sentence(3),
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Auth;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class RoleFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Auth\Role::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'display_name' => $this->faker->sentence(3),
+ 'description' => $this->faker->sentence(10),
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Auth;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+
+class UserFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Auth\User::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ $name = $this->faker->name;
+
+ return [
+ 'name' => $name,
+ 'email' => $this->faker->email,
+ 'slug' => \Illuminate\Support\Str::slug($name . '-' . \Illuminate\Support\Str::random(5)),
+ 'password' => Str::random(10),
+ 'remember_token' => Str::random(10),
+ 'email_confirmed' => 1,
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Entities\Models;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+
+class BookFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Entities\Models\Book::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->sentence,
+ 'slug' => Str::random(10),
+ 'description' => $this->faker->paragraph,
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Entities\Models;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+
+class BookshelfFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Entities\Models\Bookshelf::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->sentence,
+ 'slug' => Str::random(10),
+ 'description' => $this->faker->paragraph,
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Entities\Models;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+
+class ChapterFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Entities\Models\Chapter::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->sentence,
+ 'slug' => Str::random(10),
+ 'description' => $this->faker->paragraph,
+ ];
+ }
+}
--- /dev/null
+<?php
+
+namespace Database\Factories\Entities\Models;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+use Illuminate\Support\Str;
+
+class PageFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Entities\Models\Page::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ $html = '<p>' . implode('</p>', $this->faker->paragraphs(5)) . '</p>';
+
+ return [
+ 'name' => $this->faker->sentence,
+ 'slug' => Str::random(10),
+ 'html' => $html,
+ 'text' => strip_tags($html),
+ 'revision_count' => 1,
+ ];
+ }
+}
+++ /dev/null
-<?php
-
-/*
-|--------------------------------------------------------------------------
-| Model Factories
-|--------------------------------------------------------------------------
-|
-| Here you may define all of your model factories. Model factories give
-| you a convenient way to create models for testing and seeding your
-| database. Just tell the factory how a default model should look.
-|
-*/
-
-$factory->define(\BookStack\Auth\User::class, function ($faker) {
- $name = $faker->name;
-
- return [
- 'name' => $name,
- 'email' => $faker->email,
- 'slug' => \Illuminate\Support\Str::slug($name . '-' . \Illuminate\Support\Str::random(5)),
- 'password' => Str::random(10),
- 'remember_token' => Str::random(10),
- 'email_confirmed' => 1,
- ];
-});
-
-$factory->define(\BookStack\Entities\Models\Bookshelf::class, function ($faker) {
- return [
- 'name' => $faker->sentence,
- 'slug' => Str::random(10),
- 'description' => $faker->paragraph,
- ];
-});
-
-$factory->define(\BookStack\Entities\Models\Book::class, function ($faker) {
- return [
- 'name' => $faker->sentence,
- 'slug' => Str::random(10),
- 'description' => $faker->paragraph,
- ];
-});
-
-$factory->define(\BookStack\Entities\Models\Chapter::class, function ($faker) {
- return [
- 'name' => $faker->sentence,
- 'slug' => Str::random(10),
- 'description' => $faker->paragraph,
- ];
-});
-
-$factory->define(\BookStack\Entities\Models\Page::class, function ($faker) {
- $html = '<p>' . implode('</p>', $faker->paragraphs(5)) . '</p>';
-
- return [
- 'name' => $faker->sentence,
- 'slug' => Str::random(10),
- 'html' => $html,
- 'text' => strip_tags($html),
- 'revision_count' => 1,
- ];
-});
-
-$factory->define(\BookStack\Auth\Role::class, function ($faker) {
- return [
- 'display_name' => $faker->sentence(3),
- 'description' => $faker->sentence(10),
- ];
-});
-
-$factory->define(\BookStack\Actions\Tag::class, function ($faker) {
- return [
- 'name' => $faker->city,
- 'value' => $faker->sentence(3),
- ];
-});
-
-$factory->define(\BookStack\Uploads\Image::class, function ($faker) {
- return [
- 'name' => $faker->slug . '.jpg',
- 'url' => $faker->url,
- 'path' => $faker->url,
- 'type' => 'gallery',
- 'uploaded_to' => 0,
- ];
-});
-
-$factory->define(\BookStack\Actions\Comment::class, function ($faker) {
- $text = $faker->paragraph(1);
- $html = '<p>' . $text . '</p>';
-
- return [
- 'html' => $html,
- 'text' => $text,
- 'parent_id' => null,
- ];
-});
--- /dev/null
+<?php
+
+namespace Database\Factories\Uploads;
+
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class ImageFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = \BookStack\Uploads\Image::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->slug . '.jpg',
+ 'url' => $this->faker->url,
+ 'path' => $this->faker->url,
+ 'type' => 'gallery',
+ 'uploaded_to' => 0,
+ ];
+ }
+}
<?php
+namespace Database\Seeders;
+
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;
<?php
+namespace Database\Seeders;
+
use BookStack\Api\ApiToken;
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\Permissions\RolePermission;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Tools\SearchIndex;
use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
class DummyContentSeeder extends Seeder
public function run()
{
// Create an editor user
- $editorUser = factory(User::class)->create();
+ $editorUser = User::factory()->create();
$editorRole = Role::getRole('editor');
$editorUser->attachRole($editorRole);
// Create a viewer user
- $viewerUser = factory(User::class)->create();
+ $viewerUser = User::factory()->create();
$role = Role::getRole('viewer');
$viewerUser->attachRole($role);
$byData = ['created_by' => $editorUser->id, 'updated_by' => $editorUser->id, 'owned_by' => $editorUser->id];
- factory(\BookStack\Entities\Models\Book::class, 5)->create($byData)
+ \BookStack\Entities\Models\Book::factory()->count(5)->create($byData)
->each(function ($book) use ($byData) {
- $chapters = factory(Chapter::class, 3)->create($byData)
+ $chapters = Chapter::factory()->count(3)->create($byData)
->each(function ($chapter) use ($book, $byData) {
- $pages = factory(Page::class, 3)->make(array_merge($byData, ['book_id' => $book->id]));
+ $pages = Page::factory()->count(3)->make(array_merge($byData, ['book_id' => $book->id]));
$chapter->pages()->saveMany($pages);
});
- $pages = factory(Page::class, 3)->make($byData);
+ $pages = Page::factory()->count(3)->make($byData);
$book->chapters()->saveMany($chapters);
$book->pages()->saveMany($pages);
});
- $largeBook = factory(\BookStack\Entities\Models\Book::class)->create(array_merge($byData, ['name' => 'Large book' . Str::random(10)]));
- $pages = factory(Page::class, 200)->make($byData);
- $chapters = factory(Chapter::class, 50)->make($byData);
+ $largeBook = \BookStack\Entities\Models\Book::factory()->create(array_merge($byData, ['name' => 'Large book' . Str::random(10)]));
+ $pages = Page::factory()->count(200)->make($byData);
+ $chapters = Chapter::factory()->count(50)->make($byData);
$largeBook->pages()->saveMany($pages);
$largeBook->chapters()->saveMany($chapters);
- $shelves = factory(Bookshelf::class, 10)->create($byData);
+ $shelves = Bookshelf::factory()->count(10)->create($byData);
$largeBook->shelves()->attach($shelves->pluck('id'));
// Assign API permission to editor role and create an API key
<?php
+namespace Database\Seeders;
+
use BookStack\Auth\Permissions\PermissionService;
use BookStack\Auth\Role;
use BookStack\Auth\User;
public function run()
{
// Create an editor user
- $editorUser = factory(User::class)->create();
+ $editorUser = User::factory()->create();
$editorRole = Role::getRole('editor');
$editorUser->attachRole($editorRole);
- $largeBook = factory(\BookStack\Entities\Models\Book::class)->create(['name' => 'Large book' . Str::random(10), 'created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
- $pages = factory(Page::class, 200)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
- $chapters = factory(Chapter::class, 50)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
+ $largeBook = \BookStack\Entities\Models\Book::factory()->create(['name' => 'Large book' . Str::random(10), 'created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
+ $pages = Page::factory()->count(200)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
+ $chapters = Chapter::factory()->count(50)->make(['created_by' => $editorUser->id, 'updated_by' => $editorUser->id]);
$largeBook->pages()->saveMany($pages);
$largeBook->chapters()->saveMany($chapters);
app(PermissionService::class)->buildJointPermissions();
<?php
-/**
- * Laravel - A PHP Framework For Web Artisans.
- *
- */
+use Illuminate\Contracts\Http\Kernel;
+use BookStack\Http\Request;
+
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
-| Register The Auto Loader
+| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
-| Composer provides a convenient, automatically generated class loader for
-| our application. We just need to utilize it! We'll simply require it
-| into the script here so that we don't have to worry about manual
-| loading any of our classes later on. It feels great to relax.
+| If the application is in maintenance / demo mode via the "down" command
+| we will load this file so that any pre-rendered content can be shown
+| instead of starting the framework, which could cause an exception.
|
*/
-require __DIR__ . '/../vendor/autoload.php';
+if (file_exists(__DIR__ . '/../storage/framework/maintenance.php')) {
+ require __DIR__ . '/../storage/framework/maintenance.php';
+}
/*
|--------------------------------------------------------------------------
-| Turn On The Lights
+| Register The Auto Loader
|--------------------------------------------------------------------------
|
-| We need to illuminate PHP development, so let us turn on the lights.
-| This bootstraps the framework and gets it ready for use, then it
-| will load up this application so that we can run it and send
-| the responses back to the browser and delight our users.
+| Composer provides a convenient, automatically generated class loader for
+| this application. We just need to utilize it! We'll simply require it
+| into the script here so we don't need to manually load our classes.
|
*/
-$app = require_once __DIR__ . '/../bootstrap/app.php';
-$app->alias('request', \BookStack\Http\Request::class);
+require __DIR__ . '/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
-| Once we have the application, we can handle the incoming request
-| through the kernel, and send the associated response back to
-| the client's browser allowing them to enjoy the creative
-| and wonderful application we have prepared for them.
+| Once we have the application, we can handle the incoming request using
+| the application's HTTP kernel. Then, we will send the response back
+| to this client's browser, allowing them to enjoy our application.
|
*/
-$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
+$app = require_once __DIR__ . '/../bootstrap/app.php';
+$app->alias('request', Request::class);
-$response = $kernel->handle(
- $request = \BookStack\Http\Request::capture()
-);
+$kernel = $app->make(Kernel::class);
-$response->send();
+$response = tap($kernel->handle(
+ $request = Request::capture()
+))->send();
-$kernel->terminate($request, $response);
+$kernel->terminate($request, $response);
\ No newline at end of file
<?php
+use BookStack\Http\Controllers\Api\ApiDocsController;
+use BookStack\Http\Controllers\Api\AttachmentApiController;
+use BookStack\Http\Controllers\Api\BookApiController;
+use BookStack\Http\Controllers\Api\BookExportApiController;
+use BookStack\Http\Controllers\Api\BookshelfApiController;
+use BookStack\Http\Controllers\Api\ChapterApiController;
+use BookStack\Http\Controllers\Api\ChapterExportApiController;
+use BookStack\Http\Controllers\Api\PageApiController;
+use BookStack\Http\Controllers\Api\PageExportApiController;
+use Illuminate\Support\Facades\Route;
+
/**
* Routes for the BookStack API.
* Routes have a uri prefix of /api/.
* Controllers are all within app/Http/Controllers/Api.
*/
-Route::get('docs.json', 'ApiDocsController@json');
-
-Route::get('attachments', 'AttachmentApiController@list');
-Route::post('attachments', 'AttachmentApiController@create');
-Route::get('attachments/{id}', 'AttachmentApiController@read');
-Route::put('attachments/{id}', 'AttachmentApiController@update');
-Route::delete('attachments/{id}', 'AttachmentApiController@delete');
-
-Route::get('books', 'BookApiController@list');
-Route::post('books', 'BookApiController@create');
-Route::get('books/{id}', 'BookApiController@read');
-Route::put('books/{id}', 'BookApiController@update');
-Route::delete('books/{id}', 'BookApiController@delete');
-
-Route::get('books/{id}/export/html', 'BookExportApiController@exportHtml');
-Route::get('books/{id}/export/pdf', 'BookExportApiController@exportPdf');
-Route::get('books/{id}/export/plaintext', 'BookExportApiController@exportPlainText');
-Route::get('books/{id}/export/markdown', 'BookExportApiController@exportMarkdown');
-
-Route::get('chapters', 'ChapterApiController@list');
-Route::post('chapters', 'ChapterApiController@create');
-Route::get('chapters/{id}', 'ChapterApiController@read');
-Route::put('chapters/{id}', 'ChapterApiController@update');
-Route::delete('chapters/{id}', 'ChapterApiController@delete');
-
-Route::get('chapters/{id}/export/html', 'ChapterExportApiController@exportHtml');
-Route::get('chapters/{id}/export/pdf', 'ChapterExportApiController@exportPdf');
-Route::get('chapters/{id}/export/plaintext', 'ChapterExportApiController@exportPlainText');
-Route::get('chapters/{id}/export/markdown', 'ChapterExportApiController@exportMarkdown');
-
-Route::get('pages', 'PageApiController@list');
-Route::post('pages', 'PageApiController@create');
-Route::get('pages/{id}', 'PageApiController@read');
-Route::put('pages/{id}', 'PageApiController@update');
-Route::delete('pages/{id}', 'PageApiController@delete');
-
-Route::get('pages/{id}/export/html', 'PageExportApiController@exportHtml');
-Route::get('pages/{id}/export/pdf', 'PageExportApiController@exportPdf');
-Route::get('pages/{id}/export/plaintext', 'PageExportApiController@exportPlainText');
-Route::get('pages/{id}/export/markdown', 'PageExportApiController@exportMarkDown');
-
-Route::get('shelves', 'BookshelfApiController@list');
-Route::post('shelves', 'BookshelfApiController@create');
-Route::get('shelves/{id}', 'BookshelfApiController@read');
-Route::put('shelves/{id}', 'BookshelfApiController@update');
-Route::delete('shelves/{id}', 'BookshelfApiController@delete');
+Route::get('docs.json', [ApiDocsController::class, 'json']);
+
+Route::get('attachments', [AttachmentApiController::class, 'list']);
+Route::post('attachments', [AttachmentApiController::class, 'create']);
+Route::get('attachments/{id}', [AttachmentApiController::class, 'read']);
+Route::put('attachments/{id}', [AttachmentApiController::class, 'update']);
+Route::delete('attachments/{id}', [AttachmentApiController::class, 'delete']);
+
+Route::get('books', [BookApiController::class, 'list']);
+Route::post('books', [BookApiController::class, 'create']);
+Route::get('books/{id}', [BookApiController::class, 'read']);
+Route::put('books/{id}', [BookApiController::class, 'update']);
+Route::delete('books/{id}', [BookApiController::class, 'delete']);
+
+Route::get('books/{id}/export/html', [BookExportApiController::class, 'exportHtml']);
+Route::get('books/{id}/export/pdf', [BookExportApiController::class, 'exportPdf']);
+Route::get('books/{id}/export/plaintext', [BookExportApiController::class, 'exportPlainText']);
+Route::get('books/{id}/export/markdown', [BookExportApiController::class, 'exportMarkdown']);
+
+Route::get('chapters', [ChapterApiController::class, 'list']);
+Route::post('chapters', [ChapterApiController::class, 'create']);
+Route::get('chapters/{id}', [ChapterApiController::class, 'read']);
+Route::put('chapters/{id}', [ChapterApiController::class, 'update']);
+Route::delete('chapters/{id}', [ChapterApiController::class, 'delete']);
+
+Route::get('chapters/{id}/export/html', [ChapterExportApiController::class, 'exportHtml']);
+Route::get('chapters/{id}/export/pdf', [ChapterExportApiController::class, 'exportPdf']);
+Route::get('chapters/{id}/export/plaintext', [ChapterExportApiController::class, 'exportPlainText']);
+Route::get('chapters/{id}/export/markdown', [ChapterExportApiController::class, 'exportMarkdown']);
+
+Route::get('pages', [PageApiController::class, 'list']);
+Route::post('pages', [PageApiController::class, 'create']);
+Route::get('pages/{id}', [PageApiController::class, 'read']);
+Route::put('pages/{id}', [PageApiController::class, 'update']);
+Route::delete('pages/{id}', [PageApiController::class, 'delete']);
+
+Route::get('pages/{id}/export/html', [PageExportApiController::class, 'exportHtml']);
+Route::get('pages/{id}/export/pdf', [PageExportApiController::class, 'exportPdf']);
+Route::get('pages/{id}/export/plaintext', [PageExportApiController::class, 'exportPlainText']);
+Route::get('pages/{id}/export/markdown', [PageExportApiController::class, 'exportMarkDown']);
+
+Route::get('shelves', [BookshelfApiController::class, 'list']);
+Route::post('shelves', [BookshelfApiController::class, 'create']);
+Route::get('shelves/{id}', [BookshelfApiController::class, 'read']);
+Route::put('shelves/{id}', [BookshelfApiController::class, 'update']);
+Route::delete('shelves/{id}', [BookshelfApiController::class, 'delete']);
--- /dev/null
+<?php
+
+use Illuminate\Foundation\Inspiring;
+use Illuminate\Support\Facades\Artisan;
+
+/*
+|--------------------------------------------------------------------------
+| Console Routes
+|--------------------------------------------------------------------------
+|
+| This file is where you may define all of your Closure based console
+| commands. Each Closure is bound to a command instance allowing a
+| simple approach to interacting with each command's IO methods.
+|
+*/
+
+Artisan::command('inspire', function () {
+ $this->comment(Inspiring::quote());
+})->purpose('Display an inspiring quote');
<?php
-Route::get('/status', 'StatusController@show');
-Route::get('/robots.txt', 'HomeController@robots');
+use BookStack\Http\Controllers\Api;
+use BookStack\Http\Controllers\AttachmentController;
+use BookStack\Http\Controllers\AuditLogController;
+use BookStack\Http\Controllers\Auth;
+use BookStack\Http\Controllers\BookController;
+use BookStack\Http\Controllers\BookExportController;
+use BookStack\Http\Controllers\BookshelfController;
+use BookStack\Http\Controllers\BookSortController;
+use BookStack\Http\Controllers\ChapterController;
+use BookStack\Http\Controllers\ChapterExportController;
+use BookStack\Http\Controllers\CommentController;
+use BookStack\Http\Controllers\FavouriteController;
+use BookStack\Http\Controllers\HomeController;
+use BookStack\Http\Controllers\Images;
+use BookStack\Http\Controllers\MaintenanceController;
+use BookStack\Http\Controllers\PageController;
+use BookStack\Http\Controllers\PageExportController;
+use BookStack\Http\Controllers\PageRevisionController;
+use BookStack\Http\Controllers\PageTemplateController;
+use BookStack\Http\Controllers\RecycleBinController;
+use BookStack\Http\Controllers\RoleController;
+use BookStack\Http\Controllers\SearchController;
+use BookStack\Http\Controllers\SettingController;
+use BookStack\Http\Controllers\StatusController;
+use BookStack\Http\Controllers\TagController;
+use BookStack\Http\Controllers\UserApiTokenController;
+use BookStack\Http\Controllers\UserController;
+use BookStack\Http\Controllers\UserProfileController;
+use BookStack\Http\Controllers\UserSearchController;
+use Illuminate\Support\Facades\Route;
+
+Route::get('/status', [StatusController::class, 'show']);
+Route::get('/robots.txt', [HomeController::class, 'robots']);
// Authenticated routes...
-Route::group(['middleware' => 'auth'], function () {
+Route::middleware('auth')->group(function () {
// Secure images routing
- Route::get('/uploads/images/{path}', 'Images\ImageController@showImage')
+ Route::get('/uploads/images/{path}', [Images\ImageController::class, 'showImage'])
->where('path', '.*$');
// API docs routes
- Route::get('/api/docs', 'Api\ApiDocsController@display');
+ Route::get('/api/docs', [Api\ApiDocsController::class, 'display']);
- Route::get('/pages/recently-updated', 'PageController@showRecentlyUpdated');
+ Route::get('/pages/recently-updated', [PageController::class, 'showRecentlyUpdated']);
// Shelves
- Route::get('/create-shelf', 'BookshelfController@create');
- Route::group(['prefix' => 'shelves'], function () {
- Route::get('/', 'BookshelfController@index');
- Route::post('/', 'BookshelfController@store');
- Route::get('/{slug}/edit', 'BookshelfController@edit');
- Route::get('/{slug}/delete', 'BookshelfController@showDelete');
- Route::get('/{slug}', 'BookshelfController@show');
- Route::put('/{slug}', 'BookshelfController@update');
- Route::delete('/{slug}', 'BookshelfController@destroy');
- Route::get('/{slug}/permissions', 'BookshelfController@showPermissions');
- Route::put('/{slug}/permissions', 'BookshelfController@permissions');
- Route::post('/{slug}/copy-permissions', 'BookshelfController@copyPermissions');
-
- Route::get('/{shelfSlug}/create-book', 'BookController@create');
- Route::post('/{shelfSlug}/create-book', 'BookController@store');
+ Route::get('/create-shelf', [BookshelfController::class, 'create']);
+ Route::prefix('shelves')->group(function () {
+ Route::get('/', [BookshelfController::class, 'index']);
+ Route::post('/', [BookshelfController::class, 'store']);
+ Route::get('/{slug}/edit', [BookshelfController::class, 'edit']);
+ Route::get('/{slug}/delete', [BookshelfController::class, 'showDelete']);
+ Route::get('/{slug}', [BookshelfController::class, 'show']);
+ Route::put('/{slug}', [BookshelfController::class, 'update']);
+ Route::delete('/{slug}', [BookshelfController::class, 'destroy']);
+ Route::get('/{slug}/permissions', [BookshelfController::class, 'showPermissions']);
+ Route::put('/{slug}/permissions', [BookshelfController::class, 'permissions']);
+ Route::post('/{slug}/copy-permissions', [BookshelfController::class, 'copyPermissions']);
+
+ Route::get('/{shelfSlug}/create-book', [BookController::class, 'create']);
+ Route::post('/{shelfSlug}/create-book', [BookController::class, 'store']);
});
- Route::get('/create-book', 'BookController@create');
- Route::group(['prefix' => 'books'], function () {
+ Route::get('/create-book', [BookController::class, 'create']);
+ Route::prefix('books')->group(function () {
// Books
- Route::get('/', 'BookController@index');
- Route::post('/', 'BookController@store');
- Route::get('/{slug}/edit', 'BookController@edit');
- Route::put('/{slug}', 'BookController@update');
- Route::delete('/{id}', 'BookController@destroy');
- Route::get('/{slug}/sort-item', 'BookSortController@showItem');
- Route::get('/{slug}', 'BookController@show');
- Route::get('/{bookSlug}/permissions', 'BookController@showPermissions');
- Route::put('/{bookSlug}/permissions', 'BookController@permissions');
- Route::get('/{slug}/delete', 'BookController@showDelete');
- Route::get('/{bookSlug}/sort', 'BookSortController@show');
- Route::put('/{bookSlug}/sort', 'BookSortController@update');
- Route::get('/{bookSlug}/export/html', 'BookExportController@html');
- Route::get('/{bookSlug}/export/pdf', 'BookExportController@pdf');
- Route::get('/{bookSlug}/export/markdown', 'BookExportController@markdown');
- Route::get('/{bookSlug}/export/zip', 'BookExportController@zip');
- Route::get('/{bookSlug}/export/plaintext', 'BookExportController@plainText');
+ Route::get('/', [BookController::class, 'index']);
+ Route::post('/', [BookController::class, 'store']);
+ Route::get('/{slug}/edit', [BookController::class, 'edit']);
+ Route::put('/{slug}', [BookController::class, 'update']);
+ Route::delete('/{id}', [BookController::class, 'destroy']);
+ Route::get('/{slug}/sort-item', [BookSortController::class, 'showItem']);
+ Route::get('/{slug}', [BookController::class, 'show']);
+ Route::get('/{bookSlug}/permissions', [BookController::class, 'showPermissions']);
+ Route::put('/{bookSlug}/permissions', [BookController::class, 'permissions']);
+ Route::get('/{slug}/delete', [BookController::class, 'showDelete']);
+ Route::get('/{bookSlug}/sort', [BookSortController::class, 'show']);
+ Route::put('/{bookSlug}/sort', [BookSortController::class, 'update']);
+ Route::get('/{bookSlug}/export/html', [BookExportController::class, 'html']);
+ Route::get('/{bookSlug}/export/pdf', [BookExportController::class, 'pdf']);
+ Route::get('/{bookSlug}/export/markdown', [BookExportController::class, 'markdown']);
+ Route::get('/{bookSlug}/export/zip', [BookExportController::class, 'zip']);
+ Route::get('/{bookSlug}/export/plaintext', [BookExportController::class, 'plainText']);
// Pages
- Route::get('/{bookSlug}/create-page', 'PageController@create');
- Route::post('/{bookSlug}/create-guest-page', 'PageController@createAsGuest');
- Route::get('/{bookSlug}/draft/{pageId}', 'PageController@editDraft');
- Route::post('/{bookSlug}/draft/{pageId}', 'PageController@store');
- Route::get('/{bookSlug}/page/{pageSlug}', 'PageController@show');
- Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', 'PageExportController@pdf');
- Route::get('/{bookSlug}/page/{pageSlug}/export/html', 'PageExportController@html');
- Route::get('/{bookSlug}/page/{pageSlug}/export/markdown', 'PageExportController@markdown');
- Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', 'PageExportController@plainText');
- Route::get('/{bookSlug}/page/{pageSlug}/edit', 'PageController@edit');
- Route::get('/{bookSlug}/page/{pageSlug}/move', 'PageController@showMove');
- Route::put('/{bookSlug}/page/{pageSlug}/move', 'PageController@move');
- Route::get('/{bookSlug}/page/{pageSlug}/copy', 'PageController@showCopy');
- Route::post('/{bookSlug}/page/{pageSlug}/copy', 'PageController@copy');
- Route::get('/{bookSlug}/page/{pageSlug}/delete', 'PageController@showDelete');
- Route::get('/{bookSlug}/draft/{pageId}/delete', 'PageController@showDeleteDraft');
- Route::get('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@showPermissions');
- Route::put('/{bookSlug}/page/{pageSlug}/permissions', 'PageController@permissions');
- Route::put('/{bookSlug}/page/{pageSlug}', 'PageController@update');
- Route::delete('/{bookSlug}/page/{pageSlug}', 'PageController@destroy');
- Route::delete('/{bookSlug}/draft/{pageId}', 'PageController@destroyDraft');
+ Route::get('/{bookSlug}/create-page', [PageController::class, 'create']);
+ Route::post('/{bookSlug}/create-guest-page', [PageController::class, 'createAsGuest']);
+ Route::get('/{bookSlug}/draft/{pageId}', [PageController::class, 'editDraft']);
+ Route::post('/{bookSlug}/draft/{pageId}', [PageController::class, 'store']);
+ Route::get('/{bookSlug}/page/{pageSlug}', [PageController::class, 'show']);
+ Route::get('/{bookSlug}/page/{pageSlug}/export/pdf', [PageExportController::class, 'pdf']);
+ Route::get('/{bookSlug}/page/{pageSlug}/export/html', [PageExportController::class, 'html']);
+ Route::get('/{bookSlug}/page/{pageSlug}/export/markdown', [PageExportController::class, 'markdown']);
+ Route::get('/{bookSlug}/page/{pageSlug}/export/plaintext', [PageExportController::class, 'plainText']);
+ Route::get('/{bookSlug}/page/{pageSlug}/edit', [PageController::class, 'edit']);
+ Route::get('/{bookSlug}/page/{pageSlug}/move', [PageController::class, 'showMove']);
+ Route::put('/{bookSlug}/page/{pageSlug}/move', [PageController::class, 'move']);
+ Route::get('/{bookSlug}/page/{pageSlug}/copy', [PageController::class, 'showCopy']);
+ Route::post('/{bookSlug}/page/{pageSlug}/copy', [PageController::class, 'copy']);
+ Route::get('/{bookSlug}/page/{pageSlug}/delete', [PageController::class, 'showDelete']);
+ Route::get('/{bookSlug}/draft/{pageId}/delete', [PageController::class, 'showDeleteDraft']);
+ Route::get('/{bookSlug}/page/{pageSlug}/permissions', [PageController::class, 'showPermissions']);
+ Route::put('/{bookSlug}/page/{pageSlug}/permissions', [PageController::class, 'permissions']);
+ Route::put('/{bookSlug}/page/{pageSlug}', [PageController::class, 'update']);
+ Route::delete('/{bookSlug}/page/{pageSlug}', [PageController::class, 'destroy']);
+ Route::delete('/{bookSlug}/draft/{pageId}', [PageController::class, 'destroyDraft']);
// Revisions
- Route::get('/{bookSlug}/page/{pageSlug}/revisions', 'PageRevisionController@index');
- Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', 'PageRevisionController@show');
- Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', 'PageRevisionController@changes');
- Route::put('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', 'PageRevisionController@restore');
- Route::delete('/{bookSlug}/page/{pageSlug}/revisions/{revId}/delete', 'PageRevisionController@destroy');
+ Route::get('/{bookSlug}/page/{pageSlug}/revisions', [PageRevisionController::class, 'index']);
+ Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}', [PageRevisionController::class, 'show']);
+ Route::get('/{bookSlug}/page/{pageSlug}/revisions/{revId}/changes', [PageRevisionController::class, 'changes']);
+ Route::put('/{bookSlug}/page/{pageSlug}/revisions/{revId}/restore', [PageRevisionController::class, 'restore']);
+ Route::delete('/{bookSlug}/page/{pageSlug}/revisions/{revId}/delete', [PageRevisionController::class, 'destroy']);
// Chapters
- Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', 'PageController@create');
- Route::post('/{bookSlug}/chapter/{chapterSlug}/create-guest-page', 'PageController@createAsGuest');
- Route::get('/{bookSlug}/create-chapter', 'ChapterController@create');
- Route::post('/{bookSlug}/create-chapter', 'ChapterController@store');
- Route::get('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@show');
- Route::put('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@update');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@showMove');
- Route::put('/{bookSlug}/chapter/{chapterSlug}/move', 'ChapterController@move');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', 'ChapterController@edit');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@showPermissions');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', 'ChapterExportController@pdf');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', 'ChapterExportController@html');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/export/markdown', 'ChapterExportController@markdown');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', 'ChapterExportController@plainText');
- Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', 'ChapterController@permissions');
- Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', 'ChapterController@showDelete');
- Route::delete('/{bookSlug}/chapter/{chapterSlug}', 'ChapterController@destroy');
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/create-page', [PageController::class, 'create']);
+ Route::post('/{bookSlug}/chapter/{chapterSlug}/create-guest-page', [PageController::class, 'createAsGuest']);
+ Route::get('/{bookSlug}/create-chapter', [ChapterController::class, 'create']);
+ Route::post('/{bookSlug}/create-chapter', [ChapterController::class, 'store']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}', [ChapterController::class, 'show']);
+ Route::put('/{bookSlug}/chapter/{chapterSlug}', [ChapterController::class, 'update']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/move', [ChapterController::class, 'showMove']);
+ Route::put('/{bookSlug}/chapter/{chapterSlug}/move', [ChapterController::class, 'move']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/edit', [ChapterController::class, 'edit']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/permissions', [ChapterController::class, 'showPermissions']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/pdf', [ChapterExportController::class, 'pdf']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/html', [ChapterExportController::class, 'html']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/markdown', [ChapterExportController::class, 'markdown']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/export/plaintext', [ChapterExportController::class, 'plainText']);
+ Route::put('/{bookSlug}/chapter/{chapterSlug}/permissions', [ChapterController::class, 'permissions']);
+ Route::get('/{bookSlug}/chapter/{chapterSlug}/delete', [ChapterController::class, 'showDelete']);
+ Route::delete('/{bookSlug}/chapter/{chapterSlug}', [ChapterController::class, 'destroy']);
});
// User Profile routes
- Route::get('/user/{slug}', 'UserProfileController@show');
+ Route::get('/user/{slug}', [UserProfileController::class, 'show']);
// Image routes
- Route::get('/images/gallery', 'Images\GalleryImageController@list');
- Route::post('/images/gallery', 'Images\GalleryImageController@create');
- Route::get('/images/drawio', 'Images\DrawioImageController@list');
- Route::get('/images/drawio/base64/{id}', 'Images\DrawioImageController@getAsBase64');
- Route::post('/images/drawio', 'Images\DrawioImageController@create');
- Route::get('/images/edit/{id}', 'Images\ImageController@edit');
- Route::put('/images/{id}', 'Images\ImageController@update');
- Route::delete('/images/{id}', 'Images\ImageController@destroy');
+ Route::get('/images/gallery', [Images\GalleryImageController::class, 'list']);
+ Route::post('/images/gallery', [Images\GalleryImageController::class, 'create']);
+ Route::get('/images/drawio', [Images\DrawioImageController::class, 'list']);
+ Route::get('/images/drawio/base64/{id}', [Images\DrawioImageController::class, 'getAsBase64']);
+ Route::post('/images/drawio', [Images\DrawioImageController::class, 'create']);
+ Route::get('/images/edit/{id}', [Images\ImageController::class, 'edit']);
+ Route::put('/images/{id}', [Images\ImageController::class, 'update']);
+ Route::delete('/images/{id}', [Images\ImageController::class, 'destroy']);
// Attachments routes
- Route::get('/attachments/{id}', 'AttachmentController@get');
- Route::post('/attachments/upload', 'AttachmentController@upload');
- Route::post('/attachments/upload/{id}', 'AttachmentController@uploadUpdate');
- Route::post('/attachments/link', 'AttachmentController@attachLink');
- Route::put('/attachments/{id}', 'AttachmentController@update');
- Route::get('/attachments/edit/{id}', 'AttachmentController@getUpdateForm');
- Route::get('/attachments/get/page/{pageId}', 'AttachmentController@listForPage');
- Route::put('/attachments/sort/page/{pageId}', 'AttachmentController@sortForPage');
- Route::delete('/attachments/{id}', 'AttachmentController@delete');
+ Route::get('/attachments/{id}', [AttachmentController::class, 'get']);
+ Route::post('/attachments/upload', [AttachmentController::class, 'upload']);
+ Route::post('/attachments/upload/{id}', [AttachmentController::class, 'uploadUpdate']);
+ Route::post('/attachments/link', [AttachmentController::class, 'attachLink']);
+ Route::put('/attachments/{id}', [AttachmentController::class, 'update']);
+ Route::get('/attachments/edit/{id}', [AttachmentController::class, 'getUpdateForm']);
+ Route::get('/attachments/get/page/{pageId}', [AttachmentController::class, 'listForPage']);
+ Route::put('/attachments/sort/page/{pageId}', [AttachmentController::class, 'sortForPage']);
+ Route::delete('/attachments/{id}', [AttachmentController::class, 'delete']);
// AJAX routes
- Route::put('/ajax/page/{id}/save-draft', 'PageController@saveDraft');
- Route::get('/ajax/page/{id}', 'PageController@getPageAjax');
- Route::delete('/ajax/page/{id}', 'PageController@ajaxDestroy');
+ Route::put('/ajax/page/{id}/save-draft', [PageController::class, 'saveDraft']);
+ Route::get('/ajax/page/{id}', [PageController::class, 'getPageAjax']);
+ Route::delete('/ajax/page/{id}', [PageController::class, 'ajaxDestroy']);
// Tag routes (AJAX)
- Route::group(['prefix' => 'ajax/tags'], function () {
- Route::get('/suggest/names', 'TagController@getNameSuggestions');
- Route::get('/suggest/values', 'TagController@getValueSuggestions');
+ Route::prefix('ajax/tags')->group(function () {
+ Route::get('/suggest/names', [TagController::class, 'getNameSuggestions']);
+ Route::get('/suggest/values', [TagController::class, 'getValueSuggestions']);
});
- Route::get('/ajax/search/entities', 'SearchController@searchEntitiesAjax');
+ Route::get('/ajax/search/entities', [SearchController::class, 'searchEntitiesAjax']);
// Comments
- Route::post('/comment/{pageId}', 'CommentController@savePageComment');
- Route::put('/comment/{id}', 'CommentController@update');
- Route::delete('/comment/{id}', 'CommentController@destroy');
+ Route::post('/comment/{pageId}', [CommentController::class, 'savePageComment']);
+ Route::put('/comment/{id}', [CommentController::class, 'update']);
+ Route::delete('/comment/{id}', [CommentController::class, 'destroy']);
// Links
- Route::get('/link/{id}', 'PageController@redirectFromLink');
+ Route::get('/link/{id}', [PageController::class, 'redirectFromLink']);
// Search
- Route::get('/search', 'SearchController@search');
- Route::get('/search/book/{bookId}', 'SearchController@searchBook');
- Route::get('/search/chapter/{bookId}', 'SearchController@searchChapter');
- Route::get('/search/entity/siblings', 'SearchController@searchSiblings');
+ Route::get('/search', [SearchController::class, 'search']);
+ Route::get('/search/book/{bookId}', [SearchController::class, 'searchBook']);
+ Route::get('/search/chapter/{bookId}', [SearchController::class, 'searchChapter']);
+ Route::get('/search/entity/siblings', [SearchController::class, 'searchSiblings']);
// User Search
- Route::get('/search/users/select', 'UserSearchController@forSelect');
+ Route::get('/search/users/select', [UserSearchController::class, 'forSelect']);
// Template System
- Route::get('/templates', 'PageTemplateController@list');
- Route::get('/templates/{templateId}', 'PageTemplateController@get');
+ Route::get('/templates', [PageTemplateController::class, 'list']);
+ Route::get('/templates/{templateId}', [PageTemplateController::class, 'get']);
// Favourites
- Route::get('/favourites', 'FavouriteController@index');
- Route::post('/favourites/add', 'FavouriteController@add');
- Route::post('/favourites/remove', 'FavouriteController@remove');
+ Route::get('/favourites', [FavouriteController::class, 'index']);
+ Route::post('/favourites/add', [FavouriteController::class, 'add']);
+ Route::post('/favourites/remove', [FavouriteController::class, 'remove']);
// Other Pages
- Route::get('/', 'HomeController@index');
- Route::get('/home', 'HomeController@index');
- Route::get('/custom-head-content', 'HomeController@customHeadContent');
+ Route::get('/', [HomeController::class, 'index']);
+ Route::get('/home', [HomeController::class, 'index']);
+ Route::get('/custom-head-content', [HomeController::class, 'customHeadContent']);
// Settings
- Route::group(['prefix' => 'settings'], function () {
- Route::get('/', 'SettingController@index')->name('settings');
- Route::post('/', 'SettingController@update');
+ Route::prefix('settings')->group(function () {
+ Route::get('/', [SettingController::class, 'index'])->name('settings');
+ Route::post('/', [SettingController::class, 'update']);
// Maintenance
- Route::get('/maintenance', 'MaintenanceController@index');
- Route::delete('/maintenance/cleanup-images', 'MaintenanceController@cleanupImages');
- Route::post('/maintenance/send-test-email', 'MaintenanceController@sendTestEmail');
+ Route::get('/maintenance', [MaintenanceController::class, 'index']);
+ Route::delete('/maintenance/cleanup-images', [MaintenanceController::class, 'cleanupImages']);
+ Route::post('/maintenance/send-test-email', [MaintenanceController::class, 'sendTestEmail']);
// Recycle Bin
- Route::get('/recycle-bin', 'RecycleBinController@index');
- Route::post('/recycle-bin/empty', 'RecycleBinController@empty');
- Route::get('/recycle-bin/{id}/destroy', 'RecycleBinController@showDestroy');
- Route::delete('/recycle-bin/{id}', 'RecycleBinController@destroy');
- Route::get('/recycle-bin/{id}/restore', 'RecycleBinController@showRestore');
- Route::post('/recycle-bin/{id}/restore', 'RecycleBinController@restore');
+ Route::get('/recycle-bin', [RecycleBinController::class, 'index']);
+ Route::post('/recycle-bin/empty', [RecycleBinController::class, 'empty']);
+ Route::get('/recycle-bin/{id}/destroy', [RecycleBinController::class, 'showDestroy']);
+ Route::delete('/recycle-bin/{id}', [RecycleBinController::class, 'destroy']);
+ Route::get('/recycle-bin/{id}/restore', [RecycleBinController::class, 'showRestore']);
+ Route::post('/recycle-bin/{id}/restore', [RecycleBinController::class, 'restore']);
// Audit Log
- Route::get('/audit', 'AuditLogController@index');
+ Route::get('/audit', [AuditLogController::class, 'index']);
// Users
- Route::get('/users', 'UserController@index');
- Route::get('/users/create', 'UserController@create');
- Route::get('/users/{id}/delete', 'UserController@delete');
- Route::patch('/users/{id}/switch-books-view', 'UserController@switchBooksView');
- Route::patch('/users/{id}/switch-shelves-view', 'UserController@switchShelvesView');
- Route::patch('/users/{id}/switch-shelf-view', 'UserController@switchShelfView');
- Route::patch('/users/{id}/change-sort/{type}', 'UserController@changeSort');
- Route::patch('/users/{id}/update-expansion-preference/{key}', 'UserController@updateExpansionPreference');
- Route::patch('/users/toggle-dark-mode', 'UserController@toggleDarkMode');
- Route::post('/users/create', 'UserController@store');
- Route::get('/users/{id}', 'UserController@edit');
- Route::put('/users/{id}', 'UserController@update');
- Route::delete('/users/{id}', 'UserController@destroy');
+ Route::get('/users', [UserController::class, 'index']);
+ Route::get('/users/create', [UserController::class, 'create']);
+ Route::get('/users/{id}/delete', [UserController::class, 'delete']);
+ Route::patch('/users/{id}/switch-books-view', [UserController::class, 'switchBooksView']);
+ Route::patch('/users/{id}/switch-shelves-view', [UserController::class, 'switchShelvesView']);
+ Route::patch('/users/{id}/switch-shelf-view', [UserController::class, 'switchShelfView']);
+ Route::patch('/users/{id}/change-sort/{type}', [UserController::class, 'changeSort']);
+ Route::patch('/users/{id}/update-expansion-preference/{key}', [UserController::class, 'updateExpansionPreference']);
+ Route::patch('/users/toggle-dark-mode', [UserController::class, 'toggleDarkMode']);
+ Route::post('/users/create', [UserController::class, 'store']);
+ Route::get('/users/{id}', [UserController::class, 'edit']);
+ Route::put('/users/{id}', [UserController::class, 'update']);
+ Route::delete('/users/{id}', [UserController::class, 'destroy']);
// User API Tokens
- Route::get('/users/{userId}/create-api-token', 'UserApiTokenController@create');
- Route::post('/users/{userId}/create-api-token', 'UserApiTokenController@store');
- Route::get('/users/{userId}/api-tokens/{tokenId}', 'UserApiTokenController@edit');
- Route::put('/users/{userId}/api-tokens/{tokenId}', 'UserApiTokenController@update');
- Route::get('/users/{userId}/api-tokens/{tokenId}/delete', 'UserApiTokenController@delete');
- Route::delete('/users/{userId}/api-tokens/{tokenId}', 'UserApiTokenController@destroy');
+ Route::get('/users/{userId}/create-api-token', [UserApiTokenController::class, 'create']);
+ Route::post('/users/{userId}/create-api-token', [UserApiTokenController::class, 'store']);
+ Route::get('/users/{userId}/api-tokens/{tokenId}', [UserApiTokenController::class, 'edit']);
+ Route::put('/users/{userId}/api-tokens/{tokenId}', [UserApiTokenController::class, 'update']);
+ Route::get('/users/{userId}/api-tokens/{tokenId}/delete', [UserApiTokenController::class, 'delete']);
+ Route::delete('/users/{userId}/api-tokens/{tokenId}', [UserApiTokenController::class, 'destroy']);
// Roles
- Route::get('/roles', 'RoleController@list');
- Route::get('/roles/new', 'RoleController@create');
- Route::post('/roles/new', 'RoleController@store');
- Route::get('/roles/delete/{id}', 'RoleController@showDelete');
- Route::delete('/roles/delete/{id}', 'RoleController@delete');
- Route::get('/roles/{id}', 'RoleController@edit');
- Route::put('/roles/{id}', 'RoleController@update');
+ Route::get('/roles', [RoleController::class, 'list']);
+ Route::get('/roles/new', [RoleController::class, 'create']);
+ Route::post('/roles/new', [RoleController::class, 'store']);
+ Route::get('/roles/delete/{id}', [RoleController::class, 'showDelete']);
+ Route::delete('/roles/delete/{id}', [RoleController::class, 'delete']);
+ Route::get('/roles/{id}', [RoleController::class, 'edit']);
+ Route::put('/roles/{id}', [RoleController::class, 'update']);
});
});
// MFA routes
-Route::group(['middleware' => 'mfa-setup'], function () {
- Route::get('/mfa/setup', 'Auth\MfaController@setup');
- Route::get('/mfa/totp/generate', 'Auth\MfaTotpController@generate');
- Route::post('/mfa/totp/confirm', 'Auth\MfaTotpController@confirm');
- Route::get('/mfa/backup_codes/generate', 'Auth\MfaBackupCodesController@generate');
- Route::post('/mfa/backup_codes/confirm', 'Auth\MfaBackupCodesController@confirm');
+Route::middleware('mfa-setup')->group(function () {
+ Route::get('/mfa/setup', [Auth\MfaController::class, 'setup']);
+ Route::get('/mfa/totp/generate', [Auth\MfaTotpController::class, 'generate']);
+ Route::post('/mfa/totp/confirm', [Auth\MfaTotpController::class, 'confirm']);
+ Route::get('/mfa/backup_codes/generate', [Auth\MfaBackupCodesController::class, 'generate']);
+ Route::post('/mfa/backup_codes/confirm', [Auth\MfaBackupCodesController::class, 'confirm']);
});
-Route::group(['middleware' => 'guest'], function () {
- Route::get('/mfa/verify', 'Auth\MfaController@verify');
- Route::post('/mfa/totp/verify', 'Auth\MfaTotpController@verify');
- Route::post('/mfa/backup_codes/verify', 'Auth\MfaBackupCodesController@verify');
+Route::middleware('guest')->group(function () {
+ Route::get('/mfa/verify', [Auth\MfaController::class, 'verify']);
+ Route::post('/mfa/totp/verify', [Auth\MfaTotpController::class, 'verify']);
+ Route::post('/mfa/backup_codes/verify', [Auth\MfaBackupCodesController::class, 'verify']);
});
-Route::delete('/mfa/{method}/remove', 'Auth\MfaController@remove')->middleware('auth');
+Route::delete('/mfa/{method}/remove', [Auth\MfaController::class, 'remove'])->middleware('auth');
// Social auth routes
-Route::get('/login/service/{socialDriver}', 'Auth\SocialController@login');
-Route::get('/login/service/{socialDriver}/callback', 'Auth\SocialController@callback');
-Route::post('/login/service/{socialDriver}/detach', 'Auth\SocialController@detach')->middleware('auth');
-Route::get('/register/service/{socialDriver}', 'Auth\SocialController@register');
+Route::get('/login/service/{socialDriver}', [Auth\SocialController::class, 'login']);
+Route::get('/login/service/{socialDriver}/callback', [Auth\SocialController::class, 'callback']);
+Route::post('/login/service/{socialDriver}/detach', [Auth\SocialController::class, 'detach'])->middleware('auth');
+Route::get('/register/service/{socialDriver}', [Auth\SocialController::class, 'register']);
// Login/Logout routes
-Route::get('/login', 'Auth\LoginController@getLogin');
-Route::post('/login', 'Auth\LoginController@login');
-Route::get('/logout', 'Auth\LoginController@logout');
-Route::get('/register', 'Auth\RegisterController@getRegister');
-Route::get('/register/confirm', 'Auth\ConfirmEmailController@show');
-Route::get('/register/confirm/awaiting', 'Auth\ConfirmEmailController@showAwaiting');
-Route::post('/register/confirm/resend', 'Auth\ConfirmEmailController@resend');
-Route::get('/register/confirm/{token}', 'Auth\ConfirmEmailController@confirm');
-Route::post('/register', 'Auth\RegisterController@postRegister');
+Route::get('/login', [Auth\LoginController::class, 'getLogin']);
+Route::post('/login', [Auth\LoginController::class, 'login']);
+Route::get('/logout', [Auth\LoginController::class, 'logout']);
+Route::get('/register', [Auth\RegisterController::class, 'getRegister']);
+Route::get('/register/confirm', [Auth\ConfirmEmailController::class, 'show']);
+Route::get('/register/confirm/awaiting', [Auth\ConfirmEmailController::class, 'showAwaiting']);
+Route::post('/register/confirm/resend', [Auth\ConfirmEmailController::class, 'resend']);
+Route::get('/register/confirm/{token}', [Auth\ConfirmEmailController::class, 'confirm']);
+Route::post('/register', [Auth\RegisterController::class, 'postRegister']);
// SAML routes
-Route::post('/saml2/login', 'Auth\Saml2Controller@login');
-Route::get('/saml2/logout', 'Auth\Saml2Controller@logout');
-Route::get('/saml2/metadata', 'Auth\Saml2Controller@metadata');
-Route::get('/saml2/sls', 'Auth\Saml2Controller@sls');
-Route::post('/saml2/acs', 'Auth\Saml2Controller@startAcs');
-Route::get('/saml2/acs', 'Auth\Saml2Controller@processAcs');
+Route::post('/saml2/login', [Auth\Saml2Controller::class, 'login']);
+Route::get('/saml2/logout', [Auth\Saml2Controller::class, 'logout']);
+Route::get('/saml2/metadata', [Auth\Saml2Controller::class, 'metadata']);
+Route::get('/saml2/sls', [Auth\Saml2Controller::class, 'sls']);
+Route::post('/saml2/acs', [Auth\Saml2Controller::class, 'startAcs']);
+Route::get('/saml2/acs', [Auth\Saml2Controller::class, 'processAcs']);
// OIDC routes
-Route::post('/oidc/login', 'Auth\OidcController@login');
-Route::get('/oidc/callback', 'Auth\OidcController@callback');
+Route::post('/oidc/login', [Auth\OidcController::class, 'login']);
+Route::get('/oidc/callback', [Auth\OidcController::class, 'callback']);
// User invitation routes
-Route::get('/register/invite/{token}', 'Auth\UserInviteController@showSetPassword');
-Route::post('/register/invite/{token}', 'Auth\UserInviteController@setPassword');
+Route::get('/register/invite/{token}', [Auth\UserInviteController::class, 'showSetPassword']);
+Route::post('/register/invite/{token}', [Auth\UserInviteController::class, 'setPassword']);
// Password reset link request routes...
-Route::get('/password/email', 'Auth\ForgotPasswordController@showLinkRequestForm');
-Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
+Route::get('/password/email', [Auth\ForgotPasswordController::class, 'showLinkRequestForm']);
+Route::post('/password/email', [Auth\ForgotPasswordController::class, 'sendResetLinkEmail']);
// Password reset routes...
-Route::get('/password/reset/{token}', 'Auth\ResetPasswordController@showResetForm');
-Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
+Route::get('/password/reset/{token}', [Auth\ResetPasswordController::class, 'showResetForm']);
+Route::post('/password/reset', [Auth\ResetPasswordController::class, 'reset']);
-Route::fallback('HomeController@notFound')->name('fallback');
+Route::fallback([HomeController::class, 'notFound'])->name('fallback');
-config.php
-routes.php
compiled.php
-services.json
+config.php
+down
events.scanned.php
+maintenance.php
+routes.php
routes.scanned.php
-down
+schedule-*
+services.json
/** @var ActivityService */
protected $activityService;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->activityService = app(ActivityService::class);
{
// Set settings and get user instance
$this->setSettings(['registration-enabled' => 'true']);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
// Test form and ensure user is created
$this->get('/register')
// Set settings and get user instance
$this->setSettings(['registration-enabled' => 'true', 'registration-confirmation' => 'true']);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
// Go through registration process
$resp = $this->post('/register', $user->only('name', 'email', 'password'));
public function test_restricted_registration()
{
$this->setSettings(['registration-enabled' => 'true', 'registration-confirmation' => 'true', 'registration-restrict' => 'example.com']);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
// Go through registration process
$this->post('/register', $user->only('name', 'email', 'password'))
public function test_restricted_registration_with_confirmation_disabled()
{
$this->setSettings(['registration-enabled' => 'true', 'registration-confirmation' => 'false', 'registration-restrict' => 'example.com']);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
// Go through registration process
$this->post('/register', $user->only('name', 'email', 'password'))
protected $mockUser;
protected $resourceId = 'resource-test';
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
if (!defined('LDAP_OPT_REFERRALS')) {
]);
$this->mockLdap = \Mockery::mock(Ldap::class);
$this->app[Ldap::class] = $this->mockLdap;
- $this->mockUser = factory(User::class)->make();
+ $this->mockUser = User::factory()->make();
}
protected function runFailedAuthLogin()
public function test_login_maps_roles_and_retains_existing_roles()
{
- $roleToReceive = factory(Role::class)->create(['display_name' => 'LdapTester']);
- $roleToReceive2 = factory(Role::class)->create(['display_name' => 'LdapTester Second']);
- $existingRole = factory(Role::class)->create(['display_name' => 'ldaptester-existing']);
+ $roleToReceive = Role::factory()->create(['display_name' => 'LdapTester']);
+ $roleToReceive2 = Role::factory()->create(['display_name' => 'LdapTester Second']);
+ $existingRole = Role::factory()->create(['display_name' => 'ldaptester-existing']);
$this->mockUser->forceFill(['external_auth_id' => $this->mockUser->name])->save();
$this->mockUser->attachRole($existingRole);
public function test_login_maps_roles_and_removes_old_roles_if_set()
{
- $roleToReceive = factory(Role::class)->create(['display_name' => 'LdapTester']);
- $existingRole = factory(Role::class)->create(['display_name' => 'ldaptester-existing']);
+ $roleToReceive = Role::factory()->create(['display_name' => 'LdapTester']);
+ $existingRole = Role::factory()->create(['display_name' => 'ldaptester-existing']);
$this->mockUser->forceFill(['external_auth_id' => $this->mockUser->name])->save();
$this->mockUser->attachRole($existingRole);
public function test_external_auth_id_visible_in_roles_page_when_ldap_active()
{
- $role = factory(Role::class)->create(['display_name' => 'ldaptester', 'external_auth_id' => 'ex-auth-a, test-second-param']);
+ $role = Role::factory()->create(['display_name' => 'ldaptester', 'external_auth_id' => 'ex-auth-a, test-second-param']);
$this->asAdmin()->get('/settings/roles/' . $role->id)
->assertSee('ex-auth-a');
}
public function test_login_maps_roles_using_external_auth_ids_if_set()
{
- $roleToReceive = factory(Role::class)->create(['display_name' => 'ldaptester', 'external_auth_id' => 'test-second-param, ex-auth-a']);
- $roleToNotReceive = factory(Role::class)->create(['display_name' => 'ex-auth-a', 'external_auth_id' => 'test-second-param']);
+ $roleToReceive = Role::factory()->create(['display_name' => 'ldaptester', 'external_auth_id' => 'test-second-param, ex-auth-a']);
+ $roleToNotReceive = Role::factory()->create(['display_name' => 'ex-auth-a', 'external_auth_id' => 'test-second-param']);
app('config')->set([
'services.ldap.user_to_groups' => true,
public function test_login_group_mapping_does_not_conflict_with_default_role()
{
- $roleToReceive = factory(Role::class)->create(['display_name' => 'LdapTester']);
- $roleToReceive2 = factory(Role::class)->create(['display_name' => 'LdapTester Second']);
+ $roleToReceive = Role::factory()->create(['display_name' => 'LdapTester']);
+ $roleToReceive2 = Role::factory()->create(['display_name' => 'LdapTester Second']);
$this->mockUser->forceFill(['external_auth_id' => $this->mockUser->name])->save();
setting()->put('registration-role', $roleToReceive->id);
public function test_login_with_email_confirmation_required_maps_groups_but_shows_confirmation_screen()
{
- $roleToReceive = factory(Role::class)->create(['display_name' => 'LdapTester']);
- $user = factory(User::class)->make();
+ $roleToReceive = Role::factory()->create(['display_name' => 'LdapTester']);
+ $user = User::factory()->make();
setting()->put('registration-confirmation', 'true');
app('config')->set([
protected $keyFilePath;
protected $keyFile;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
// Set default config for OpenID Connect
]);
}
- public function tearDown(): void
+ protected function tearDown(): void
{
parent::tearDown();
if (file_exists($this->keyFilePath)) {
class Saml2Test extends TestCase
{
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
// Set default config for SAML2
'saml2.remove_from_groups' => false,
]);
- $memberRole = factory(Role::class)->create(['external_auth_id' => 'member']);
+ $memberRole = Role::factory()->create(['external_auth_id' => 'member']);
$adminRole = Role::getSystemRole('admin');
$this->followingRedirects()->post('/saml2/acs', ['SAMLResponse' => $this->acsPostData]);
$acsPost = $this->followingRedirects()->post('/saml2/acs', ['SAMLResponse' => $this->acsPostData]);
$user = User::query()->where('external_auth_id', '=', 'user')->first();
- $randomRole = factory(Role::class)->create(['external_auth_id' => 'random']);
+ $randomRole = Role::factory()->create(['external_auth_id' => 'random']);
$user->attachRole($randomRole);
$this->assertContains($randomRole->id, $user->roles()->pluck('id'));
'saml2.remove_from_groups' => false,
]);
- $memberRole = factory(Role::class)->create(['external_auth_id' => 'member']);
+ $memberRole = Role::factory()->create(['external_auth_id' => 'member']);
$adminRole = Role::getSystemRole('admin');
$acsPost = $this->followingRedirects()->post('/saml2/acs', ['SAMLResponse' => $this->acsPostData]);
{
public function test_social_registration()
{
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$this->setSettings(['registration-enabled' => 'true']);
config(['GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']);
'APP_URL' => 'http://localhost',
]);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$mockSocialite = $this->mock(Factory::class);
$mockSocialDriver = Mockery::mock(Provider::class);
$mockSocialUser = Mockery::mock(\Laravel\Socialite\Contracts\User::class);
'APP_URL' => 'http://localhost', 'services.google.auto_register' => true, 'services.google.auto_confirm' => true,
]);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$mockSocialite = $this->mock(Factory::class);
$mockSocialDriver = Mockery::mock(Provider::class);
$mockSocialUser = Mockery::mock(\Laravel\Socialite\Contracts\User::class);
public function test_social_registration_with_no_name_uses_email_as_name()
{
$this->setSettings(['registration-enabled' => 'true']);
config(['GITHUB_APP_ID' => 'abc123', 'GITHUB_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']);
public function test_shelves_shows_in_header_if_have_any_shelve_view_permission()
{
- $user = factory(User::class)->create();
+ $user = User::factory()->create();
$this->giveUserPermissions($user, ['image-create-all']);
$shelf = Bookshelf::first();
$userRole = $user->roles()->first();
{
public function test_create()
{
- $book = factory(Book::class)->make([
+ $book = Book::factory()->make([
'name' => 'My First Book',
]);
public function test_create_uses_different_slugs_when_name_reused()
{
- $book = factory(Book::class)->make([
+ $book = Book::factory()->make([
'name' => 'My First Book',
]);
/** @var Book $book */
$book = Book::query()->first();
- $chapter = factory(Chapter::class)->make([
+ $chapter = Chapter::factory()->make([
'name' => 'My First Chapter',
]);
{
protected $page;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->page = Page::query()->first();
$this->asAdmin();
$page = Page::first();
- $comment = factory(Comment::class)->make(['parent_id' => 2]);
+ $comment = Comment::factory()->make(['parent_id' => 2]);
$resp = $this->postJson("/comment/$page->id", $comment->getAttributes());
$resp->assertStatus(200);
$this->asAdmin();
$page = Page::first();
- $comment = factory(Comment::class)->make();
+ $comment = Comment::factory()->make();
$this->postJson("/comment/$page->id", $comment->getAttributes());
$comment = $page->comments()->first();
$this->asAdmin();
$page = Page::first();
- $comment = factory(Comment::class)->make();
+ $comment = Comment::factory()->make();
$this->postJson("/comment/$page->id", $comment->getAttributes());
$comment = $page->comments()->first();
*/
protected $pageRepo;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->page = Page::query()->first();
/** @var Page */
protected $page;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->page = Page::query()->first();
{
/** @var Chapter $chapter */
$chapter = Chapter::query()->first();
- $page = factory(Page::class)->make([
+ $page = Page::factory()->make([
'name' => 'My First Page',
]);
{
protected $book;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->book = Book::first();
$entity = $class::first();
if (is_null($tags)) {
- $tags = factory(Tag::class, $this->defaultTagCount)->make();
+ $tags = Tag::factory()->count($this->defaultTagCount)->make();
}
$entity->tags()->saveMany($tags);
{
// Create some tags with similar names to test with
$attrs = collect();
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'country']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'color']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'city']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'county']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'planet']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'plans']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'country']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'color']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'city']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'county']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'planet']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'plans']));
$page = $this->getEntityWithTags(Page::class, $attrs->all());
- $this->asAdmin()->get('/ajax/tags/suggest/names?search=dog')->assertExactJson([]);
- $this->get('/ajax/tags/suggest/names?search=co')->assertExactJson(['color', 'country', 'county']);
- $this->get('/ajax/tags/suggest/names?search=cou')->assertExactJson(['country', 'county']);
- $this->get('/ajax/tags/suggest/names?search=pla')->assertExactJson(['planet', 'plans']);
+ $this->asAdmin()->get('/ajax/tags/suggest/names?search=dog')->assertSimilarJson([]);
+ $this->get('/ajax/tags/suggest/names?search=co')->assertSimilarJson(['color', 'country', 'county']);
+ $this->get('/ajax/tags/suggest/names?search=cou')->assertSimilarJson(['country', 'county']);
+ $this->get('/ajax/tags/suggest/names?search=pla')->assertSimilarJson(['planet', 'plans']);
}
public function test_tag_value_suggestions()
{
// Create some tags with similar values to test with
$attrs = collect();
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'country', 'value' => 'cats']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'color', 'value' => 'cattery']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'city', 'value' => 'castle']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'county', 'value' => 'dog']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'planet', 'value' => 'catapult']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'plans', 'value' => 'dodgy']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'country', 'value' => 'cats']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'color', 'value' => 'cattery']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'city', 'value' => 'castle']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'county', 'value' => 'dog']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'planet', 'value' => 'catapult']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'plans', 'value' => 'dodgy']));
$page = $this->getEntityWithTags(Page::class, $attrs->all());
- $this->asAdmin()->get('/ajax/tags/suggest/values?search=ora')->assertExactJson([]);
- $this->get('/ajax/tags/suggest/values?search=cat')->assertExactJson(['cats', 'cattery', 'catapult']);
- $this->get('/ajax/tags/suggest/values?search=do')->assertExactJson(['dog', 'dodgy']);
- $this->get('/ajax/tags/suggest/values?search=cas')->assertExactJson(['castle']);
+ $this->asAdmin()->get('/ajax/tags/suggest/values?search=ora')->assertSimilarJson([]);
+ $this->get('/ajax/tags/suggest/values?search=cat')->assertSimilarJson(['cats', 'cattery', 'catapult']);
+ $this->get('/ajax/tags/suggest/values?search=do')->assertSimilarJson(['dog', 'dodgy']);
+ $this->get('/ajax/tags/suggest/values?search=cas')->assertSimilarJson(['castle']);
}
public function test_entity_permissions_effect_tag_suggestions()
{
// Create some tags with similar names to test with and save to a page
$attrs = collect();
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'country']));
- $attrs = $attrs->merge(factory(Tag::class, 5)->make(['name' => 'color']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'country']));
+ $attrs = $attrs->merge(Tag::factory()->count(5)->make(['name' => 'color']));
$page = $this->getEntityWithTags(Page::class, $attrs->all());
- $this->asAdmin()->get('/ajax/tags/suggest/names?search=co')->assertExactJson(['color', 'country']);
- $this->asEditor()->get('/ajax/tags/suggest/names?search=co')->assertExactJson(['color', 'country']);
+ $this->asAdmin()->get('/ajax/tags/suggest/names?search=co')->assertSimilarJson(['color', 'country']);
+ $this->asEditor()->get('/ajax/tags/suggest/names?search=co')->assertSimilarJson(['color', 'country']);
// Set restricted permission the page
$page->restricted = true;
$page->save();
$page->rebuildPermissions();
- $this->asAdmin()->get('/ajax/tags/suggest/names?search=co')->assertExactJson(['color', 'country']);
- $this->asEditor()->get('/ajax/tags/suggest/names?search=co')->assertExactJson([]);
+ $this->asAdmin()->get('/ajax/tags/suggest/names?search=co')->assertSimilarJson(['color', 'country']);
+ $this->asEditor()->get('/ajax/tags/suggest/names?search=co')->assertSimilarJson([]);
}
public function test_tags_shown_on_search_listing()
{
$tags = [
- factory(Tag::class)->make(['name' => 'category', 'value' => 'buckets']),
- factory(Tag::class)->make(['name' => 'color', 'value' => 'red']),
+ Tag::factory()->make(['name' => 'category', 'value' => 'buckets']),
+ Tag::factory()->make(['name' => 'color', 'value' => 'red']),
];
$page = $this->getEntityWithTags(Page::class, $tags);
public function test_new_users_dont_have_any_recently_viewed()
{
- $user = factory(User::class)->create();
+ $user = User::factory()->create();
$viewRole = Role::getRole('Viewer');
$user->attachRole($viewRole);
/**
* LanguageTest constructor.
*/
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
*/
protected $viewer;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->user = $this->getEditor();
{
protected $user;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->user = $this->getViewer();
$this->giveUserPermissions($this->user, ['image-update-all']);
/** @var Page $page */
$page = Page::query()->first();
- $image = factory(Image::class)->create([
+ $image = Image::factory()->create([
'uploaded_to' => $page->id,
'created_by' => $this->user->id,
'updated_by' => $this->user->id,
$admin = $this->getAdmin();
/** @var Page $page */
$page = Page::query()->first();
- $image = factory(Image::class)->create(['uploaded_to' => $page->id, 'created_by' => $admin->id, 'updated_by' => $admin->id]);
+ $image = Image::factory()->create(['uploaded_to' => $page->id, 'created_by' => $admin->id, 'updated_by' => $admin->id]);
$this->actingAs($this->user)->json('delete', '/images/' . $image->id)->assertStatus(403);
{
$admin = $this->getAdmin();
// Book links
- $book = factory(Book::class)->create(['created_by' => $admin->id, 'updated_by' => $admin->id]);
+ $book = Book::factory()->create(['created_by' => $admin->id, 'updated_by' => $admin->id]);
$this->regenEntityPermissions($book);
$this->actingAs($this->getViewer())->get($book->getUrl())
->assertDontSee('Create a new page')
->assertDontSee('Add a chapter');
// Chapter links
- $chapter = factory(Chapter::class)->create(['created_by' => $admin->id, 'updated_by' => $admin->id, 'book_id' => $book->id]);
+ $chapter = Chapter::factory()->create(['created_by' => $admin->id, 'updated_by' => $admin->id, 'book_id' => $book->id]);
$this->regenEntityPermissions($chapter);
$this->actingAs($this->getViewer())->get($chapter->getUrl())
->assertDontSee('Create a new page')
private function addComment(Page $page): TestResponse
{
- $comment = factory(Comment::class)->make();
+ $comment = Comment::factory()->make();
return $this->postJson("/comment/$page->id", $comment->only('text', 'html'));
}
private function updateComment(Comment $comment): TestResponse
{
- $commentData = factory(Comment::class)->make();
+ $commentData = Comment::factory()->make();
return $this->putJson("/comment/{$comment->id}", $commentData->only('text', 'html'));
}
protected function createNewRole(array $permissions = []): Role
{
$permissionRepo = app(PermissionsRepo::class);
- $roleData = factory(Role::class)->make()->toArray();
+ $roleData = Role::factory()->make()->toArray();
$roleData['permissions'] = array_flip($permissions);
return $permissionRepo->saveNewRole($roleData);
}
$userAttrs = ['created_by' => $creatorUser->id, 'owned_by' => $creatorUser->id, 'updated_by' => $updaterUser->id];
- $book = factory(Book::class)->create($userAttrs);
- $chapter = factory(Chapter::class)->create(array_merge(['book_id' => $book->id], $userAttrs));
- $page = factory(Page::class)->create(array_merge(['book_id' => $book->id, 'chapter_id' => $chapter->id], $userAttrs));
+ $book = Book::factory()->create($userAttrs);
+ $chapter = Chapter::factory()->create(array_merge(['book_id' => $book->id], $userAttrs));
+ $page = Page::factory()->create(array_merge(['book_id' => $book->id, 'chapter_id' => $chapter->id], $userAttrs));
$restrictionService = $this->app[PermissionService::class];
$restrictionService->buildJointPermissionsForEntity($book);
Theme::listen(ThemeEvents::AUTH_REGISTER, $callback);
$this->setSettings(['registration-enabled' => 'true']);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$this->post('/register', ['email' => $user->email, 'name' => $user->name, 'password' => 'password']);
$this->assertCount(2, $args);
config()->set([
'services.disable_services' => false,
]);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$this->assertImageFetchFrom('https://www.gravatar.com/avatar/' . md5(strtolower($user->email)) . '?s=500&d=identicon');
$user = $this->createUserRequest($user);
'services.avatar_url' => 'https://example.com/${email}/${hash}/${size}',
]);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$url = 'https://example.com/' . urlencode(strtolower($user->email)) . '/' . md5(strtolower($user->email)) . '/500';
$this->assertImageFetchFrom($url);
'services.disable_services' => true,
]);
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$http = $this->mock(HttpFetcher::class);
$http->shouldNotReceive('fetch');
$logger = $this->withTestLogger();
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$this->createUserRequest($user);
$this->assertTrue($logger->hasError('Failed to save user avatar image'));
}
public function test_user_creation()
{
/** @var User $user */
- $user = factory(User::class)->make();
+ $user = User::factory()->make();
$adminRole = Role::getRole('admin');
$resp = $this->asAdmin()->get('/settings/users');
*/
protected $user;
- public function setUp(): void
+ protected function setUp(): void
{
parent::setUp();
$this->user = User::all()->last();
public function test_profile_page_shows_created_content_counts()
{
- $newUser = factory(User::class)->create();
+ $newUser = User::factory()->create();
$this->asAdmin()->get('/user/' . $newUser->slug)
->assertSee($newUser->name)
public function test_profile_page_shows_recent_activity()
{
- $newUser = factory(User::class)->create();
+ $newUser = User::factory()->create();
$this->actingAs($newUser);
$entities = $this->createEntityChainBelongingToUser($newUser, $newUser);
Activity::addForEntity($entities['book'], ActivityType::BOOK_UPDATE);
public function test_user_activity_has_link_leading_to_profile()
{
- $newUser = factory(User::class)->create();
+ $newUser = User::factory()->create();
$this->actingAs($newUser);
$entities = $this->createEntityChainBelongingToUser($newUser, $newUser);
Activity::addForEntity($entities['book'], ActivityType::BOOK_UPDATE);