├── .dockerignore ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .node-version ├── .prettierrc ├── .styleci.yml ├── Dockerfile ├── README.md ├── apache.conf ├── app ├── Console │ ├── CartridgeCommand.php │ ├── Commands │ │ ├── Initialize.php │ │ └── Scan.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── PlatformsController.php │ │ │ └── UsersController.php │ │ ├── Auth │ │ │ └── LoginController.php │ │ ├── Controller.php │ │ ├── FileController.php │ │ ├── GameController.php │ │ ├── HomeController.php │ │ └── PlatformController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── LogLevel.php ├── Models │ ├── File.php │ ├── Game.php │ ├── Platform.php │ └── User.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php ├── cache │ └── .gitignore └── helpers.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cartridge.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── igdb.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── scout.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2022_05_18_060919_add_is_admin_to_users.php │ ├── 2022_05_18_062000_create_games_table.php │ ├── 2022_05_18_062034_create_platforms_table.php │ ├── 2022_05_18_062057_create_files_table.php │ ├── 2022_06_08_223408_remove_email_from_users.php │ ├── 2022_07_13_233312_add_name_to_platforms.php │ ├── 2022_07_13_233642_add_name_to_games.php │ └── 2022_07_13_234643_add_directory_name_to_platforms.php └── seeders │ └── DatabaseSeeder.php ├── docker-compose.test.yml ├── docker-compose.yml ├── docker-entrypoint.sh ├── lang └── en │ ├── auth.php │ ├── pagination.php │ ├── passwords.php │ └── validation.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public └── .gitignore ├── resources ├── js │ ├── app.js │ ├── components │ │ ├── AppLogo.vue │ │ ├── CsrfToken.vue │ │ ├── GameList.vue │ │ ├── Icon.vue │ │ ├── LoadingAnimation.vue │ │ ├── NavBar.vue │ │ └── NotFound.vue │ ├── routes.js │ └── views │ │ ├── GameView.vue │ │ ├── LibraryView.vue │ │ └── SearchView.vue ├── sass │ ├── _variables.scss │ └── app.scss └── views │ ├── admin │ ├── dashboard.blade.php │ ├── platforms │ │ ├── index.blade.php │ │ └── modify.blade.php │ └── users │ │ ├── index.blade.php │ │ └── modify.blade.php │ ├── auth │ └── login.blade.php │ ├── components │ ├── flash.blade.php │ └── forms │ │ ├── radio-input.blade.php │ │ ├── text-input.blade.php │ │ └── toggle-input.blade.php │ ├── home.blade.php │ └── layouts │ ├── admin.blade.php │ └── app.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── static ├── .htaccess ├── favicon.ico ├── favicon.svg ├── icons │ ├── slash.svg │ └── x.svg ├── images │ └── logo-full.png ├── index.php └── robots.txt ├── storage ├── app │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | vendor 3 | 4 | .git 5 | **/.gitignore 6 | .gitattributes 7 | 8 | public/**/** 9 | .env.example 10 | 11 | .editorconfig 12 | .prettierrc 13 | .styleci.yml 14 | 15 | phpunit.xml 16 | 17 | docker-compose.yml 18 | Dockerfile 19 | .dockerignore 20 | docker-build.log 21 | 22 | # Maintain storage directory structure 23 | storage/app/* 24 | storage/app/public/* 25 | storage/framework/cache/data/* 26 | storage/framework/sessions/* 27 | storage/framework/testing/* 28 | storage/framework/views/* 29 | storage/logs/* -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = false 7 | indent_style = tab 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_style = space 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | # Volumes 2 | GAMES_PATH= 3 | 4 | # IGDB credentials 5 | TWITCH_CLIENT_ID= 6 | TWITCH_CLIENT_SECRET= -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /storage/*.key 3 | /vendor 4 | .env 5 | .env.backup 6 | .phpunit.result.cache 7 | Homestead.json 8 | Homestead.yaml 9 | npm-debug.log 10 | /.vscode 11 | yarn-error.log 12 | /.idea 13 | /.vscode 14 | docker-build.log -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | v18.3.0 2 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /.styleci.yml: -------------------------------------------------------------------------------- 1 | php: 2 | preset: laravel 3 | disabled: 4 | - no_unused_imports 5 | finder: 6 | not-name: 7 | - index.php 8 | js: 9 | finder: 10 | not-name: 11 | - webpack.mix.js 12 | css: true 13 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG VARIANT=8-apache 2 | FROM php:${VARIANT} 3 | 4 | # Prepare user 5 | ARG PUID=1000 6 | ARG PGID=1000 7 | RUN \ 8 | groupadd -g ${PGID} cartridge && \ 9 | useradd -u ${PUID} -g ${PGID} cartridge 10 | 11 | # Install packages 12 | RUN \ 13 | echo "🌐 Installing dependencies" && \ 14 | apt-get update && \ 15 | apt-get install -y --no-install-recommends \ 16 | git \ 17 | cron \ 18 | unzip \ 19 | nodejs \ 20 | npm \ 21 | zip && \ 22 | echo "🧹 Cleaning up" && \ 23 | rm -rf \ 24 | /tmp/* \ 25 | /var/lib/apt/lists/* \ 26 | /var/tmp/* 27 | 28 | # Enable Apache modules 29 | RUN \ 30 | a2enmod rewrite 31 | 32 | # Add Apache conf 33 | COPY apache.conf /etc/apache2/sites-available/000-default.conf 34 | 35 | # Install PHP extensions 36 | RUN \ 37 | docker-php-ext-install \ 38 | mysqli \ 39 | pdo \ 40 | pdo_mysql 41 | 42 | # Prepare workdir 43 | RUN mkdir -p /var/www/cartridge && chown cartridge:cartridge /var/www/cartridge 44 | WORKDIR /var/www/cartridge 45 | COPY --chown=cartridge:cartridge . . 46 | 47 | # Get latest Composer 48 | ARG COMPOSER_VERSION=latest 49 | COPY --from=composer:2 /usr/bin/composer /usr/bin/composer 50 | RUN \ 51 | echo "🎵 Installing Composer packages" && \ 52 | composer install && \ 53 | echo "🧹 Cleaning up" && \ 54 | composer clearcache 55 | 56 | # Node 57 | RUN \ 58 | echo "💿 Installing Node packages" && \ 59 | npm install && \ 60 | npm run build && \ 61 | echo "🧹 Cleaning up" && \ 62 | rm -rf node_modules 63 | 64 | # Install scheduler to cron 65 | RUN \ 66 | echo "⏳ Installing scheduler" && \ 67 | CRONFILE=/etc/cron.d/scheduler && \ 68 | mkdir -p /etc/cron.d && \ 69 | touch $CRONFILE && \ 70 | echo "* * * * * cd ${PWD} && php artisan schedule:run" >> $CRONFILE && \ 71 | chmod 0644 $CRONFILE && \ 72 | crontab $CRONFILE 73 | 74 | # Expose stuff 75 | USER cartridge 76 | VOLUME /games 77 | VOLUME /var/www/cartridge/storage 78 | EXPOSE 80 79 | 80 | CMD ["apache2-foreground"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### ⚠️ Deprecated 2 | New repository at [jamjnsn/cartridge](https://github.com/jamjnsn/cartridge). 3 | 4 | --- 5 | 6 |
7 | Logo 8 |

9 | A self-hosted game browser. 10 |

11 |
12 | 13 | ## About 14 | ![Cartridge Screenshot](https://user-images.githubusercontent.com/1876231/169448529-54259dc2-0ad6-44eb-bc3e-df56220a6e64.png) 15 | Cartridge is a convenient browser for your game collection with easy file downloads and automatically imported metadata and images. This project is designed to be self-hosted on your local server. 16 | 17 | ## Roadmap 18 | Cartridge is currently in development and not yet ready for use. Here's a rough to-do list for an alpha release: 19 | 20 | - ~~Game importer~~ 21 | - ~~Game browser & downloads~~ 22 | - Game search 23 | - ~~User administration (create, edit, delete)~~ 24 | - Manual IGDB match fix 25 | 26 | ## Development 27 | Cartridge currently utilizes [Laravel Sail](https://laravel.com/docs/9.x/sail) for a convenient dev environment. By default, the app runs on port 80 and HMR runs on port 8080. 28 | 29 | ### Requirements 30 | - PHP 8.1 _(Optional)_ 31 | - [Composer](https://getcomposer.org/) _(Optional)_ 32 | - [Docker](https://docs.docker.com/get-docker/) 33 | - [Docker Compose](https://docs.docker.com/compose/install/) 34 | - API key from [IGDB](https://api-docs.igdb.com/#about) 35 | 36 | ### Instructions 37 | 1. Clone the repository. 38 | ```sh 39 | git clone https://github.com/jamjnsn/cartridge.git 40 | ``` 41 | 2. Install Composer packages using your local Composer: 42 | ```sh 43 | composer install 44 | ``` 45 | OR using a temporary container: 46 | ```sh 47 | docker run --rm \ 48 | -u "$(id -u):$(id -g)" \ 49 | -v $(pwd):/var/www/html \ 50 | -w /var/www/html \ 51 | laravelsail/php81-composer:latest \ 52 | composer install --ignore-platform-reqs 53 | ``` 54 | 3. Install Node packages 55 | ```sh 56 | sail npm i 57 | ``` 58 | 5. Create `.env` file. 59 | ``` 60 | # Volumes 61 | GAMES_PATH=/path/to/roms 62 | 63 | # IGDB credentials 64 | TWITCH_CLIENT_ID=Your Client ID 65 | TWITCH_CLIENT_SECRET=Your Client Secret 66 | ``` 67 | 4. Initialize application. (__Note:__ This should be run outside of the container to ensure the storage symlinks are created properly.) 68 | ```sh 69 | sail artisan cart:init 70 | ``` 71 | 5. Start containers with Sail. 72 | ```sh 73 | alias sail="bash vendor/bin/sail" # Optional: add alias to your shell profile 74 | sail up -d 75 | ``` 76 | 6. Start HMR. 77 | ``` 78 | sail npm run watch 79 | ``` 80 | 81 | ## Built With 82 | * [Vue.js](https://vuejs.org/) 83 | * [Laravel](https://laravel.com) 84 | -------------------------------------------------------------------------------- /apache.conf: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /var/www/cartridge/public 3 | -------------------------------------------------------------------------------- /app/Console/CartridgeCommand.php: -------------------------------------------------------------------------------- 1 | "; 23 | break; 24 | case LogLevel::Warning: 25 | $style = ""; 26 | break; 27 | default: 28 | $style = ''; 29 | break; 30 | } 31 | 32 | $this->line($style.$message.''); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Console/Commands/Initialize.php: -------------------------------------------------------------------------------- 1 | message('Scanning for new files', LogLevel::Info); 57 | 58 | $gamesPath = config('cartridge.games_path'); 59 | 60 | foreach (scandir($gamesPath) as $file) { 61 | $filePath = $gamesPath . '/' . $file; 62 | 63 | // Ignore dotfiles 64 | if (substr($file, 0, 1) != '.' && is_dir($filePath)) { 65 | $this->scanDirectory($filePath); 66 | } 67 | } 68 | 69 | return 0; 70 | } 71 | 72 | private function scanDirectory($dir) 73 | { 74 | $dirName = basename($dir); 75 | $relativeDir = str_replace(config('cartridge.games_path'), '', $dir); 76 | sleep(config('cartridge.api_rate_delay')); 77 | 78 | // Get platform if it exists 79 | $platform = Platform::firstOrNew(['directory_name' => $dirName]); 80 | 81 | if($platform->exists) { 82 | // Get IGDB data from existing platform slug 83 | $platformData = IGDBPlatform::where('slug', $platform->slug)->first(); 84 | 85 | // No IGDB platform data found 86 | if ($platformData == null) { 87 | $this->message("Existing platform with slug {$platform->slug} was not found on IGDB", LogLevel::Warning); 88 | return null; 89 | } 90 | } else { 91 | // Attempt to identify platform on IGDB based on directory name 92 | $platformData = IGDBPlatform::where('name', $dirName)->orWhere('alternative_name', $dirName)->first(); 93 | 94 | // No IGDB platform data found 95 | if ($platformData == null) { 96 | $this->message("Could not identify platform for directory '{$dirName}'", LogLevel::Warning); 97 | return null; 98 | } else { 99 | $this->message("🕹️ Adding platform: {$platformData->name} from $dir", LogLevel::Info); 100 | 101 | // Add found platform data 102 | $platform->slug = $platformData->slug; 103 | $platform->name = $platformData->name; 104 | $platform->directory_name = $dirName; 105 | } 106 | } 107 | 108 | // Update platform metadata and save 109 | $platform->data = json_decode($platformData->toJson()); 110 | $platform->save(); 111 | 112 | // Fetch logo image if one doesn't exist 113 | if (!Storage::disk('public')->exists($platform->logo_path)) { 114 | $logo = IGDBPlatformLogo::where('id', '=', $platform->data->platform_logo)->first(); 115 | sleep(config('cartridge.api_rate_delay')); 116 | 117 | if ($logo != null) { 118 | $this->downloadImage($logo->image_id, $platform->logo_path, 'cover_big'); 119 | } 120 | } 121 | 122 | foreach (scandir($dir) as $file) { 123 | if (!is_dir($file)) { 124 | $gamePath = $relativeDir . '/' . $file; 125 | 126 | if (!File::where('path', '=', $gamePath)->exists()) { 127 | $gameData = $this->identifyGame($file, $platform); 128 | 129 | if ($gameData == null) { 130 | $this->message('No match found for ' . $gamePath, LogLevel::Warning); 131 | } else { 132 | $game = $this->updateGame($gameData, $file); 133 | 134 | $this->updateFileRecord( 135 | $gamePath, 136 | $platform, 137 | $game 138 | ); 139 | } 140 | } 141 | } 142 | } 143 | } 144 | 145 | private function updateFileRecord($filePath, $platform, $game) 146 | { 147 | $file = File::firstOrNew(['path' => $filePath]); 148 | $file->path = $filePath; 149 | $file->platform_id = $platform->id; 150 | $file->game_id = $game->id; 151 | $file->save(); 152 | } 153 | 154 | private function identifyGame($file, $platform) 155 | { 156 | $pathinfo = pathinfo($file); 157 | $filenameClean = preg_replace("/(?:\(.+\))?\s*(?:\[.+\])?\.(?:.*)/", "", $pathinfo['basename']); 158 | 159 | $games = IGDBGame::where('release_dates.platform', $platform->data->id); 160 | sleep(config('cartridge.api_rate_delay')); 161 | 162 | $match = $games->search($filenameClean)->first(); 163 | return $match; 164 | } 165 | 166 | private function updateGame($data, $filename) 167 | { 168 | $game = Game::firstOrNew(['slug' => $data->slug]); 169 | 170 | // Set game name and slug if this game is newly added 171 | if(!$game->exists) { 172 | $this->message("🎮 Adding game: {$data->name}", LogLevel::Info); 173 | $game->name = $data->name; 174 | $game->slug = $data->slug; 175 | } 176 | 177 | $game->data = json_decode($data->toJson()); 178 | $game->save(); 179 | 180 | $coverImagePath = 'covers/' . $game->slug; 181 | $screenshotPath = 'screenshots/' . $game->slug; 182 | 183 | if (!Storage::disk('public')->exists($coverImagePath)) { 184 | $cover = IGDBCover::where('id', '=', $data->cover)->first(); 185 | sleep(config('cartridge.api_rate_delay')); 186 | 187 | if ($cover != null) { 188 | $this->downloadImage($cover->image_id, $coverImagePath, 'cover_big'); 189 | } 190 | } 191 | 192 | if (!Storage::disk('public')->exists($screenshotPath)) { 193 | $screenshot = IGDBScreenshot::where('game', '=', $game->data->id)->first(); 194 | sleep(config('cartridge.api_rate_delay')); 195 | 196 | if ($screenshot != null) { 197 | $this->downloadImage($screenshot->image_id, $screenshotPath, 'screenshot_big'); 198 | } 199 | } 200 | 201 | return $game; 202 | } 203 | 204 | private function downloadImage($igdbImageId, $filePath, $size = 'cover_big') 205 | { 206 | $url = "https://images.igdb.com/igdb/image/upload/t_$size/$igdbImageId.png"; 207 | 208 | $pathinfo = pathinfo($url); 209 | $contents = @file_get_contents($url); 210 | 211 | if ($contents) { 212 | Storage::disk('public')->put($filePath . '.' . $pathinfo['extension'], $contents); 213 | } 214 | } 215 | } 216 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | $this->reportable(function (Throwable $e) { 47 | // 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/PlatformsController.php: -------------------------------------------------------------------------------- 1 | $platforms]); 20 | } 21 | 22 | public function create() 23 | { 24 | return view('admin.platforms.modify', ['platform' => new Platform(), 'is_edit_mode' => false]); 25 | } 26 | 27 | public function store(Request $request) 28 | { 29 | $validated = $request->validate([ 30 | 'slug' => [ 31 | 'required', 32 | Rule::unique('platforms') 33 | ], 34 | 'name' => [ 35 | 'required', 36 | Rule::unique('platforms') 37 | ], 38 | 'directory_name' => [ 39 | 'required', 40 | Rule::unique('platforms') 41 | ], 42 | ]); 43 | 44 | $validated['data'] = []; 45 | Platform::create($validated); 46 | return redirect()->route('platforms.index'); 47 | } 48 | 49 | public function show(Platform $platform) 50 | { 51 | // 52 | } 53 | 54 | public function edit(Platform $platform) 55 | { 56 | return view('admin.platforms.modify', ['is_edit_mode' => true, 'platform' => $platform]); 57 | } 58 | 59 | public function update(Platform $platform, Request $request) 60 | { 61 | $validated = $request->validate([ 62 | 'slug' => [ 63 | 'required', 64 | Rule::unique('platforms')->ignore($platform->id) 65 | ], 66 | 'name' => [ 67 | 'required', 68 | Rule::unique('platforms')->ignore($platform->id) 69 | ], 70 | 'directory_name' => [ 71 | 'required', 72 | Rule::unique('platforms')->ignore($platform->id) 73 | ], 74 | ]); 75 | 76 | $platform->update($validated); 77 | return redirect()->route('platforms.index'); 78 | } 79 | 80 | public function destroy(Platform $platform, Request $request) 81 | { 82 | $platform_name = $platform->name; 83 | $platform->delete(); 84 | $request->session()->flash('status', ['type' => 'error', 'message' => 'Deleted platform ' . $platform_name . '.']); 85 | return redirect()->route('platforms.index'); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/UsersController.php: -------------------------------------------------------------------------------- 1 | $users]); 18 | } 19 | 20 | public function create() 21 | { 22 | return view('admin.users.modify', ['user' => new User(), 'is_edit_mode' => false]); 23 | } 24 | 25 | public function store(Request $request) 26 | { 27 | $rules = User::$validations; 28 | $rules['name'] .= '|required'; 29 | $rules['password'] .= '|confirmed|required'; 30 | 31 | 32 | $validated = $request->validate($rules); 33 | $validated['password'] = Hash::make($validated['password']); 34 | 35 | $user = new User; 36 | $user->fill($validated); 37 | $user->is_admin = $request->is_admin === 'true'; 38 | 39 | if ($user->save()) { 40 | return redirect()->route('users.index'); 41 | } else { 42 | echo "Error!"; // TODO: Handle this. 43 | } 44 | } 45 | 46 | public function edit(User $user) 47 | { 48 | return view('admin.users.modify', ['is_edit_mode' => true, 'user' => $user]); 49 | } 50 | 51 | public function update(User $user, Request $request) 52 | { 53 | $rules = User::$validations; 54 | 55 | // Skip name validation if it has not changed 56 | if ($request->name === $user->name) { 57 | unset($rules['name']); 58 | } 59 | 60 | // Skip password validation if new one isn't provided 61 | if (empty($request->password) && empty($request->password_confirmation)) { 62 | unset($rules['password']); 63 | } else { 64 | // Enforce confirmation if new password provided 65 | $rules['password'] .= '|confirmed'; 66 | } 67 | 68 | $validated = $request->validate($rules); 69 | 70 | if (key_exists('password', $validated)) { 71 | $validated['password'] = Hash::make($validated['password']); 72 | } 73 | 74 | $user->fill($validated); 75 | $user->is_admin = $request->is_admin === 'true'; 76 | 77 | if ($user->save()) { 78 | return redirect()->route('users.index'); 79 | } else { 80 | echo "Error!"; // TODO: Handle this. 81 | } 82 | } 83 | 84 | public function destroy(User $user, Request $request) { 85 | if($user->id === 1) { 86 | $request->session()->flash('status', ['type' => 'error', 'message' => 'Unable to delete primary user.']); 87 | return redirect()->route('users.index'); 88 | } else { 89 | $user_name = $user->name; 90 | $user->delete(); 91 | $request->session()->flash('status', ['type' => 'error', 'message' => 'Deleted user ' . $user_name . '.']); 92 | return redirect()->route('users.index'); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 40 | } 41 | 42 | public function login(Request $request) 43 | { 44 | $input = $request->only(['name', 'password']); 45 | 46 | $this->validate($request, [ 47 | 'name' => 'required', 48 | 'password' => 'required', 49 | ]); 50 | 51 | if (auth()->attempt(array('name' => $input['name'], 'password' => $input['password']))) { 52 | return redirect()->route('home'); 53 | } else { 54 | return redirect()->route('login') 55 | ->with('error', 'Invalid credentials provided.'); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | first(); 14 | return Storage::disk('games')->download($file->path, $filename); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/Http/Controllers/GameController.php: -------------------------------------------------------------------------------- 1 | input('limit', config('cartridge.default_per_page')); 19 | $search = $request->input('search', ''); 20 | 21 | $query = Game::limit($limit)->with('files'); 22 | 23 | if ($search != '') { 24 | // Apply search 25 | } 26 | 27 | return response()->json($query->get()); 28 | } 29 | 30 | public function search(Request $request, $query) 31 | { 32 | $results = Game::search($query)->get(); 33 | return response()->json($results); 34 | } 35 | 36 | /** 37 | * Display the specified resource. 38 | * 39 | * @param int $id 40 | * @return \Illuminate\Http\Response 41 | */ 42 | public function show(Request $request, $slug) 43 | { 44 | $game = Game::findBySlug($slug); 45 | 46 | if ($game == null) { 47 | return response()->json('No results found.', 404); 48 | } else { 49 | return response()->json($game); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Http/Controllers/HomeController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 17 | } 18 | 19 | /** 20 | * Show the application dashboard. 21 | * 22 | * @return \Illuminate\Contracts\Support\Renderable 23 | */ 24 | public function index() 25 | { 26 | return view('home'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/PlatformController.php: -------------------------------------------------------------------------------- 1 | input('search', ''); 18 | $platforms = null; 19 | 20 | if ($search == '') { 21 | $platforms = Platform::all(); 22 | } else { 23 | $platforms = Platform::where('data', 'like', '%' . $search . '%')->get(); 24 | } 25 | 26 | return response()->json($platforms); 27 | } 28 | 29 | /** 30 | * Display the specified resource. 31 | * 32 | * @param int $id 33 | * @return \Illuminate\Http\Response 34 | */ 35 | public function show(Request $request, $slug) 36 | { 37 | $platform = Platform::findBySlug($slug); 38 | 39 | if ($platform == null) { 40 | return response()->json('No results found.', 404); 41 | } else { 42 | return response()->json($platform); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/LogLevel.php: -------------------------------------------------------------------------------- 1 | belongsTo(Game::class); 20 | } 21 | 22 | public function platform() 23 | { 24 | return $this->belongsTo(Platform::class); 25 | } 26 | 27 | public function getPlatformNameAttribute() 28 | { 29 | return $this->platform(); 30 | } 31 | 32 | public function getDownloadUrlAttribute() 33 | { 34 | $pathinfo = pathinfo($this->path); 35 | 36 | return route('download', [ 37 | 'id' => $this->id, 38 | 'filename' => $this->game->name . '.' . $pathinfo['extension'] 39 | ]); 40 | } 41 | 42 | public function getPathExistsAttribute() 43 | { 44 | return Storage::disk('games')->exists($this->path); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Models/Game.php: -------------------------------------------------------------------------------- 1 | 'object' 20 | ]; 21 | 22 | protected $appends = ['name', 'description', 'screenshot', 'cover']; 23 | 24 | public function toSearchableArray() 25 | { 26 | $searchable = $this->toArray(); 27 | return $searchable; 28 | } 29 | 30 | public function files() 31 | { 32 | return $this->hasMany(File::class)->with('platform'); 33 | } 34 | 35 | public function getDescriptionAttribute() 36 | { 37 | $description = $this->data->summary ?? $this->data->storyline ?? ''; 38 | return nl2br(htmlentities($description)); 39 | } 40 | 41 | public function getNameAttribute() 42 | { 43 | return $this->data->name ?? $this->data->alternate_name ?? ''; 44 | } 45 | 46 | public function getCoverAttribute() 47 | { 48 | return Storage::disk('public')->url('/covers/' . $this->slug . '.png'); 49 | } 50 | 51 | public function getScreenshotAttribute() 52 | { 53 | return Storage::disk('public')->url('/screenshots/' . $this->slug . '.png'); 54 | } 55 | 56 | public static function whereFileExists() 57 | { 58 | return Game::whereIn('id', File::distinct()->select('game_id')->get()); 59 | } 60 | 61 | public static function whereFileExistsForPlatform($platform) 62 | { 63 | $files = File::distinct()->where('platform_id', $platform->id)->select('game_id')->get(); 64 | return Game::whereIn('id', $files); 65 | } 66 | 67 | public static function findBySlug($slug) 68 | { 69 | return Game::where('slug', $slug)->with('files')->first(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Models/Platform.php: -------------------------------------------------------------------------------- 1 | 'object' 16 | ]; 17 | 18 | public function getGamesAttribute() 19 | { 20 | return Game::whereFileExistsForPlatform($this)->get(); 21 | } 22 | 23 | public function getLogoPathAttribute() { 24 | return 'platforms/' . $this->slug; 25 | } 26 | 27 | public static function whereFileExists() 28 | { 29 | return Platform::whereIn('id', File::distinct()->select('platform_id')->get()); 30 | } 31 | 32 | public static function findBySlug($slug) 33 | { 34 | return Platform::where('slug', $slug)->first(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'unique:users|min:2|max:30', 16 | 'password' => 'min:6' 17 | ]; 18 | 19 | /** 20 | * The attributes that are mass assignable. 21 | * 22 | * @var string[] 23 | */ 24 | protected $fillable = [ 25 | 'name', 26 | 'password' 27 | ]; 28 | 29 | /** 30 | * The attributes that should be hidden for serialization. 31 | * 32 | * @var array 33 | */ 34 | protected $hidden = [ 35 | 'password', 36 | 'remember_token' 37 | ]; 38 | 39 | /** 40 | * The attributes that should be cast. 41 | * 42 | * @var array 43 | */ 44 | protected $casts = [ 45 | 'is_admin' => 'boolean' 46 | ]; 47 | } 48 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | 33 | /** 34 | * Determine if events and listeners should be automatically discovered. 35 | * 36 | * @return bool 37 | */ 38 | public function shouldDiscoverEvents() 39 | { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | 41 | /** 42 | * Configure the rate limiters for the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configureRateLimiting() 47 | { 48 | RateLimiter::for('api', function (Request $request) { 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /bootstrap/helpers.php: -------------------------------------------------------------------------------- 1 | 'Cartridge', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Application Environment 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This value determines the "environment" your application is currently 26 | | running in. This may determine how you prefer to configure various 27 | | services the application utilizes. Set this in your ".env" file. 28 | | 29 | */ 30 | 31 | 'env' => env('APP_ENV', 'local'), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Application Debug Mode 36 | |-------------------------------------------------------------------------- 37 | | 38 | | When your application is in debug mode, detailed error messages with 39 | | stack traces will be shown on every error that occurs within your 40 | | application. If disabled, a simple generic error page is shown. 41 | | 42 | */ 43 | 44 | 'debug' => (bool) env('APP_DEBUG', true), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Application URL 49 | |-------------------------------------------------------------------------- 50 | | 51 | | This URL is used by the console to properly generate URLs when using 52 | | the Artisan command line tool. You should set this to the root of 53 | | your application so that it is used when running Artisan tasks. 54 | | 55 | */ 56 | 57 | 'url' => app_url(), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Timezone 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the default timezone for your application, which 65 | | will be used by the PHP date and date-time functions. We have gone 66 | | ahead and set this to a sensible default for you out of the box. 67 | | 68 | */ 69 | 70 | 'timezone' => 'UTC', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Locale Configuration 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The application locale determines the default locale that will be used 78 | | by the translation service provider. You are free to set this value 79 | | to any of the locales which will be supported by the application. 80 | | 81 | */ 82 | 83 | 'locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Application Fallback Locale 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The fallback locale determines the locale to use when the current one 91 | | is not available. You may change the value to correspond to any of 92 | | the language folders that are provided through your application. 93 | | 94 | */ 95 | 96 | 'fallback_locale' => 'en', 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Faker Locale 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This locale will be used by the Faker PHP library when generating fake 104 | | data for your database seeds. For example, this will be used to get 105 | | localized telephone numbers, street address information and more. 106 | | 107 | */ 108 | 109 | 'faker_locale' => 'en_US', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Encryption Key 114 | |-------------------------------------------------------------------------- 115 | | 116 | | This key is used by the Illuminate encrypter service and should be set 117 | | to a random, 32 character string, otherwise these encrypted strings 118 | | will not be safe. Please do this before deploying an application! 119 | | 120 | */ 121 | 122 | 'key' => env('APP_KEY'), 123 | 124 | 'cipher' => 'AES-256-CBC', 125 | 126 | /* 127 | |-------------------------------------------------------------------------- 128 | | Maintenance Mode Driver 129 | |-------------------------------------------------------------------------- 130 | | 131 | | These configuration options determine the driver used to determine and 132 | | manage Laravel's "maintenance mode" status. The "cache" driver will 133 | | allow maintenance mode to be controlled across multiple machines. 134 | | 135 | | Supported drivers: "file", "cache" 136 | | 137 | */ 138 | 139 | 'maintenance' => [ 140 | 'driver' => 'file', 141 | // 'store' => 'redis', 142 | ], 143 | 144 | /* 145 | |-------------------------------------------------------------------------- 146 | | Autoloaded Service Providers 147 | |-------------------------------------------------------------------------- 148 | | 149 | | The service providers listed here will be automatically loaded on the 150 | | request to your application. Feel free to add your own services to 151 | | this array to grant expanded functionality to your applications. 152 | | 153 | */ 154 | 155 | 'providers' => [ 156 | 157 | /* 158 | * Laravel Framework Service Providers... 159 | */ 160 | Illuminate\Auth\AuthServiceProvider::class, 161 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 162 | Illuminate\Bus\BusServiceProvider::class, 163 | Illuminate\Cache\CacheServiceProvider::class, 164 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 165 | Illuminate\Cookie\CookieServiceProvider::class, 166 | Illuminate\Database\DatabaseServiceProvider::class, 167 | Illuminate\Encryption\EncryptionServiceProvider::class, 168 | Illuminate\Filesystem\FilesystemServiceProvider::class, 169 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 170 | Illuminate\Hashing\HashServiceProvider::class, 171 | Illuminate\Mail\MailServiceProvider::class, 172 | Illuminate\Notifications\NotificationServiceProvider::class, 173 | Illuminate\Pagination\PaginationServiceProvider::class, 174 | Illuminate\Pipeline\PipelineServiceProvider::class, 175 | Illuminate\Queue\QueueServiceProvider::class, 176 | Illuminate\Redis\RedisServiceProvider::class, 177 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 178 | Illuminate\Session\SessionServiceProvider::class, 179 | Illuminate\Translation\TranslationServiceProvider::class, 180 | Illuminate\Validation\ValidationServiceProvider::class, 181 | Illuminate\View\ViewServiceProvider::class, 182 | 183 | /* 184 | * Package Service Providers... 185 | */ 186 | 187 | /* 188 | * Application Service Providers... 189 | */ 190 | App\Providers\AppServiceProvider::class, 191 | App\Providers\AuthServiceProvider::class, 192 | // App\Providers\BroadcastServiceProvider::class, 193 | App\Providers\EventServiceProvider::class, 194 | App\Providers\RouteServiceProvider::class, 195 | 196 | ], 197 | 198 | /* 199 | |-------------------------------------------------------------------------- 200 | | Class Aliases 201 | |-------------------------------------------------------------------------- 202 | | 203 | | This array of class aliases will be registered when this application 204 | | is started. However, feel free to register as many as you wish as 205 | | the aliases are "lazy" loaded so they don't hinder performance. 206 | | 207 | */ 208 | 209 | 'aliases' => Facade::defaultAliases()->merge([ 210 | // 'ExampleClass' => App\Example\ExampleClass::class, 211 | ])->toArray(), 212 | 213 | ]; 214 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => App\Models\User::class, 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 82 | | 83 | | The expire time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | */ 88 | 89 | 'passwords' => [ 90 | 'users' => [ 91 | 'provider' => 'users', 92 | 'table' => 'password_resets', 93 | 'expire' => 60, 94 | 'throttle' => 60, 95 | ], 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Password Confirmation Timeout 101 | |-------------------------------------------------------------------------- 102 | | 103 | | Here you may define the amount of seconds before a password confirmation 104 | | times out and the user is prompted to re-enter their password via the 105 | | confirmation screen. By default, the timeout lasts for three hours. 106 | | 107 | */ 108 | 109 | 'password_timeout' => 10800, 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | 'client_options' => [ 43 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 44 | ], 45 | ], 46 | 47 | 'ably' => [ 48 | 'driver' => 'ably', 49 | 'key' => env('ABLY_KEY'), 50 | ], 51 | 52 | 'redis' => [ 53 | 'driver' => 'redis', 54 | 'connection' => 'default', 55 | ], 56 | 57 | 'log' => [ 58 | 'driver' => 'log', 59 | ], 60 | 61 | 'null' => [ 62 | 'driver' => 'null', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /config/cartridge.php: -------------------------------------------------------------------------------- 1 | 0.5, 5 | "games_path" => '/games', 6 | "default_per_page" => 100 7 | ]; 8 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', 'db'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'cartridge'), 52 | 'username' => env('DB_USERNAME', 'cartridge'), 53 | 'password' => env('DB_PASSWORD', 'cartridge'), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'search_path' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | // 'encrypt' => env('DB_ENCRYPT', 'yes'), 93 | // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), 94 | ], 95 | 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Migration Repository Table 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This table keeps track of all the migrations that have already run for 104 | | your application. Using this information, we can determine which of 105 | | the migrations on disk haven't actually been run in the database. 106 | | 107 | */ 108 | 109 | 'migrations' => 'migrations', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Redis Databases 114 | |-------------------------------------------------------------------------- 115 | | 116 | | Redis is an open source, fast, and advanced key-value store that also 117 | | provides a richer body of commands than a typical key-value system 118 | | such as APC or Memcached. Laravel makes it easy to dig right in. 119 | | 120 | */ 121 | 122 | 'redis' => [ 123 | 124 | 'client' => env('REDIS_CLIENT', 'phpredis'), 125 | 126 | 'options' => [ 127 | 'cluster' => env('REDIS_CLUSTER', 'redis'), 128 | 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 129 | ], 130 | 131 | 'default' => [ 132 | 'url' => env('REDIS_URL'), 133 | 'host' => env('REDIS_HOST', '127.0.0.1'), 134 | 'username' => env('REDIS_USERNAME'), 135 | 'password' => env('REDIS_PASSWORD'), 136 | 'port' => env('REDIS_PORT', '6379'), 137 | 'database' => env('REDIS_DB', '0'), 138 | ], 139 | 140 | 'cache' => [ 141 | 'url' => env('REDIS_URL'), 142 | 'host' => env('REDIS_HOST', '127.0.0.1'), 143 | 'username' => env('REDIS_USERNAME'), 144 | 'password' => env('REDIS_PASSWORD'), 145 | 'port' => env('REDIS_PORT', '6379'), 146 | 'database' => env('REDIS_CACHE_DB', '1'), 147 | ], 148 | 149 | ], 150 | 151 | ]; 152 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => app_url('/storage'), 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 'games' => [ 48 | 'driver' => 'local', 49 | 'root' => '/games', 50 | 'url' => app_url('/files/games'), 51 | 'visibility' => 'public', 52 | ], 53 | 54 | 's3' => [ 55 | 'driver' => 's3', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'region' => env('AWS_DEFAULT_REGION'), 59 | 'bucket' => env('AWS_BUCKET'), 60 | 'url' => env('AWS_URL'), 61 | 'endpoint' => env('AWS_ENDPOINT'), 62 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 63 | 'throw' => false, 64 | ], 65 | 66 | ], 67 | 68 | /* 69 | |-------------------------------------------------------------------------- 70 | | Symbolic Links 71 | |-------------------------------------------------------------------------- 72 | | 73 | | Here you may configure the symbolic links that will be created when the 74 | | `storage:link` Artisan command is executed. The array keys should be 75 | | the locations of the links and the values should be their targets. 76 | | 77 | */ 78 | 79 | 'links' => [ 80 | public_path('storage') => storage_path('app/public'), 81 | ], 82 | 83 | ]; 84 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/igdb.php: -------------------------------------------------------------------------------- 1 | [ 8 | 'client_id' => env('TWITCH_CLIENT_ID', ''), 9 | 'client_secret' => env('TWITCH_CLIENT_SECRET', ''), 10 | ], 11 | 12 | /* 13 | * This package caches queries automatically (for 1 hour per default). 14 | * Here you can set how long each query should be cached (in seconds). 15 | * 16 | * To turn cache off set this value to 0 17 | */ 18 | 'cache_lifetime' => env('IGDB_CACHE_LIFETIME', 3600), 19 | 20 | /* 21 | * Path where the webhooks should be handled. 22 | */ 23 | 'webhook_path' => 'igdb-webhook/handle', 24 | 25 | /* 26 | * The webhook secret. 27 | * 28 | * This needs to be a string of your choice in order to use the webhook 29 | * functionality. 30 | */ 31 | 'webhook_secret' => env('IGDB_WEBHOOK_SECRET'), 32 | ]; 33 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => [ 34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 35 | 'trace' => false, 36 | ], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Log Channels 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Here you may configure the log channels for your application. Out of 44 | | the box, Laravel uses the Monolog PHP logging library. This gives 45 | | you a variety of powerful log handlers / formatters to utilize. 46 | | 47 | | Available Drivers: "single", "daily", "slack", "syslog", 48 | | "errorlog", "monolog", 49 | | "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 'stack' => [ 55 | 'driver' => 'stack', 56 | 'channels' => ['single'], 57 | 'ignore_exceptions' => false, 58 | ], 59 | 60 | 'single' => [ 61 | 'driver' => 'single', 62 | 'path' => storage_path('logs/laravel.log'), 63 | 'level' => env('LOG_LEVEL', 'debug'), 64 | ], 65 | 66 | 'daily' => [ 67 | 'driver' => 'daily', 68 | 'path' => storage_path('logs/laravel.log'), 69 | 'level' => env('LOG_LEVEL', 'debug'), 70 | 'days' => 14, 71 | ], 72 | 73 | 'slack' => [ 74 | 'driver' => 'slack', 75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 76 | 'username' => 'Laravel Log', 77 | 'emoji' => ':boom:', 78 | 'level' => env('LOG_LEVEL', 'critical'), 79 | ], 80 | 81 | 'papertrail' => [ 82 | 'driver' => 'monolog', 83 | 'level' => env('LOG_LEVEL', 'debug'), 84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 85 | 'handler_with' => [ 86 | 'host' => env('PAPERTRAIL_URL'), 87 | 'port' => env('PAPERTRAIL_PORT'), 88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 89 | ], 90 | ], 91 | 92 | 'stderr' => [ 93 | 'driver' => 'monolog', 94 | 'level' => env('LOG_LEVEL', 'debug'), 95 | 'handler' => StreamHandler::class, 96 | 'formatter' => env('LOG_STDERR_FORMATTER'), 97 | 'with' => [ 98 | 'stream' => 'php://stderr', 99 | ], 100 | ], 101 | 102 | 'syslog' => [ 103 | 'driver' => 'syslog', 104 | 'level' => env('LOG_LEVEL', 'debug'), 105 | ], 106 | 107 | 'errorlog' => [ 108 | 'driver' => 'errorlog', 109 | 'level' => env('LOG_LEVEL', 'debug'), 110 | ], 111 | 112 | 'null' => [ 113 | 'driver' => 'monolog', 114 | 'handler' => NullHandler::class, 115 | ], 116 | 117 | 'emergency' => [ 118 | 'path' => storage_path('logs/laravel.log'), 119 | ], 120 | ], 121 | 122 | ]; 123 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | 74 | 'failover' => [ 75 | 'transport' => 'failover', 76 | 'mailers' => [ 77 | 'smtp', 78 | 'log', 79 | ], 80 | ], 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Global "From" Address 86 | |-------------------------------------------------------------------------- 87 | | 88 | | You may wish for all e-mails sent by your application to be sent from 89 | | the same address. Here, you may specify a name and address that is 90 | | used globally for all e-mails that are sent by your application. 91 | | 92 | */ 93 | 94 | 'from' => [ 95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 96 | 'name' => env('MAIL_FROM_NAME', 'Example'), 97 | ], 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Markdown Mail Settings 102 | |-------------------------------------------------------------------------- 103 | | 104 | | If you are using Markdown based email rendering, you may configure your 105 | | theme and component paths here, allowing you to customize the design 106 | | of the emails. Or, you may simply stick with the Laravel defaults! 107 | | 108 | */ 109 | 110 | 'markdown' => [ 111 | 'theme' => 'default', 112 | 113 | 'paths' => [ 114 | resource_path('views/vendor/mail'), 115 | ], 116 | ], 117 | 118 | ]; 119 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/scout.php: -------------------------------------------------------------------------------- 1 | env('SCOUT_DRIVER', 'meilisearch'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Index Prefix 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify a prefix that will be applied to all search index 26 | | names used by Scout. This prefix may be useful if you have multiple 27 | | "tenants" or applications sharing the same search infrastructure. 28 | | 29 | */ 30 | 31 | 'prefix' => env('SCOUT_PREFIX', ''), 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Queue Data Syncing 36 | |-------------------------------------------------------------------------- 37 | | 38 | | This option allows you to control if the operations that sync your data 39 | | with your search engines are queued. When this is set to "true" then 40 | | all automatic data syncing will get queued for better performance. 41 | | 42 | */ 43 | 44 | 'queue' => env('SCOUT_QUEUE', false), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Database Transactions 49 | |-------------------------------------------------------------------------- 50 | | 51 | | This configuration option determines if your data will only be synced 52 | | with your search indexes after every open database transaction has 53 | | been committed, thus preventing any discarded data from syncing. 54 | | 55 | */ 56 | 57 | 'after_commit' => false, 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Chunk Sizes 62 | |-------------------------------------------------------------------------- 63 | | 64 | | These options allow you to control the maximum chunk size when you are 65 | | mass importing data into the search engine. This allows you to fine 66 | | tune each of these chunk sizes based on the power of the servers. 67 | | 68 | */ 69 | 70 | 'chunk' => [ 71 | 'searchable' => 500, 72 | 'unsearchable' => 500, 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Soft Deletes 78 | |-------------------------------------------------------------------------- 79 | | 80 | | This option allows to control whether to keep soft deleted records in 81 | | the search indexes. Maintaining soft deleted records can be useful 82 | | if your application still needs to search for the records later. 83 | | 84 | */ 85 | 86 | 'soft_delete' => false, 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Identify User 91 | |-------------------------------------------------------------------------- 92 | | 93 | | This option allows you to control whether to notify the search engine 94 | | of the user performing the search. This is sometimes useful if the 95 | | engine supports any analytics based on this application's users. 96 | | 97 | | Supported engines: "algolia" 98 | | 99 | */ 100 | 101 | 'identify' => env('SCOUT_IDENTIFY', false), 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Algolia Configuration 106 | |-------------------------------------------------------------------------- 107 | | 108 | | Here you may configure your Algolia settings. Algolia is a cloud hosted 109 | | search engine which works great with Scout out of the box. Just plug 110 | | in your application ID and admin API key to get started searching. 111 | | 112 | */ 113 | 114 | 'algolia' => [ 115 | 'id' => env('ALGOLIA_APP_ID', ''), 116 | 'secret' => env('ALGOLIA_SECRET', ''), 117 | ], 118 | 119 | /* 120 | |-------------------------------------------------------------------------- 121 | | MeiliSearch Configuration 122 | |-------------------------------------------------------------------------- 123 | | 124 | | Here you may configure your MeiliSearch settings. MeiliSearch is an open 125 | | source search engine with minimal configuration. Below, you can state 126 | | the host and key information for your own MeiliSearch installation. 127 | | 128 | | See: https://docs.meilisearch.com/guides/advanced_guides/configuration.html 129 | | 130 | */ 131 | 132 | 'meilisearch' => [ 133 | 'host' => env('MEILISEARCH_HOST', 'http://meilisearch:7700'), 134 | 'key' => env('MEILISEARCH_KEY', null), 135 | ], 136 | 137 | ]; 138 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION'), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | While using one of the framework's cache driven session backends you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE'), 104 | 105 | /* 106 | |-------------------------------------------------------------------------- 107 | | Session Sweeping Lottery 108 | |-------------------------------------------------------------------------- 109 | | 110 | | Some session drivers must manually sweep their storage location to get 111 | | rid of old sessions from storage. Here are the chances that it will 112 | | happen on a given request. By default, the odds are 2 out of 100. 113 | | 114 | */ 115 | 116 | 'lottery' => [2, 100], 117 | 118 | /* 119 | |-------------------------------------------------------------------------- 120 | | Session Cookie Name 121 | |-------------------------------------------------------------------------- 122 | | 123 | | Here you may change the name of the cookie used to identify a session 124 | | instance by ID. The name specified here will get used every time a 125 | | new session cookie is created by the framework for every driver. 126 | | 127 | */ 128 | 129 | 'cookie' => env( 130 | 'SESSION_COOKIE', 131 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 132 | ), 133 | 134 | /* 135 | |-------------------------------------------------------------------------- 136 | | Session Cookie Path 137 | |-------------------------------------------------------------------------- 138 | | 139 | | The session cookie path determines the path for which the cookie will 140 | | be regarded as available. Typically, this will be the root path of 141 | | your application but you are free to change this when necessary. 142 | | 143 | */ 144 | 145 | 'path' => '/', 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Session Cookie Domain 150 | |-------------------------------------------------------------------------- 151 | | 152 | | Here you may change the domain of the cookie used to identify a session 153 | | in your application. This will determine which domains the cookie is 154 | | available to in your application. A sensible default has been set. 155 | | 156 | */ 157 | 158 | 'domain' => env('SESSION_DOMAIN'), 159 | 160 | /* 161 | |-------------------------------------------------------------------------- 162 | | HTTPS Only Cookies 163 | |-------------------------------------------------------------------------- 164 | | 165 | | By setting this option to true, session cookies will only be sent back 166 | | to the server if the browser has a HTTPS connection. This will keep 167 | | the cookie from being sent to you when it can't be done securely. 168 | | 169 | */ 170 | 171 | 'secure' => env('SESSION_SECURE_COOKIE'), 172 | 173 | /* 174 | |-------------------------------------------------------------------------- 175 | | HTTP Access Only 176 | |-------------------------------------------------------------------------- 177 | | 178 | | Setting this value to true will prevent JavaScript from accessing the 179 | | value of the cookie and the cookie will only be accessible through 180 | | the HTTP protocol. You are free to modify this option if needed. 181 | | 182 | */ 183 | 184 | 'http_only' => true, 185 | 186 | /* 187 | |-------------------------------------------------------------------------- 188 | | Same-Site Cookies 189 | |-------------------------------------------------------------------------- 190 | | 191 | | This option determines how your cookies behave when cross-site requests 192 | | take place, and can be used to mitigate CSRF attacks. By default, we 193 | | will set this value to "lax" since this is a secure default value. 194 | | 195 | | Supported: "lax", "strict", "none", null 196 | | 197 | */ 198 | 199 | 'same_site' => 'lax', 200 | 201 | ]; 202 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition() 19 | { 20 | return [ 21 | 'name' => $this->faker->name(), 22 | 'email' => $this->faker->unique()->safeEmail(), 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | } 28 | 29 | /** 30 | * Indicate that the model's email address should be unverified. 31 | * 32 | * @return static 33 | */ 34 | public function unverified() 35 | { 36 | return $this->state(function (array $attributes) { 37 | return [ 38 | 'email_verified_at' => null, 39 | ]; 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('personal_access_tokens'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2022_05_18_060919_add_is_admin_to_users.php: -------------------------------------------------------------------------------- 1 | boolean('is_admin')->default(false); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('users', function (Blueprint $table) { 29 | $table->dropColumn('is_admin'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_05_18_062000_create_games_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | 19 | $table->string('slug')->unique(); 20 | $table->json('data'); 21 | 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('games'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_05_18_062034_create_platforms_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | 19 | $table->string('slug')->unique(); 20 | $table->json('data'); 21 | 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('platforms'); 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /database/migrations/2022_05_18_062057_create_files_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | 19 | $table->string('path')->unique(); 20 | 21 | $table->unsignedBigInteger('platform_id'); 22 | $table->foreign('platform_id')->references('id')->on('platforms'); 23 | 24 | $table->unsignedBigInteger('game_id'); 25 | $table->foreign('game_id')->references('id')->on('games'); 26 | 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('files'); 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /database/migrations/2022_06_08_223408_remove_email_from_users.php: -------------------------------------------------------------------------------- 1 | dropColumn('email'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('users', function (Blueprint $table) { 29 | $table->string('email')->unique(); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_07_13_233312_add_name_to_platforms.php: -------------------------------------------------------------------------------- 1 | string('name')->unique()->after('id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('platforms', function (Blueprint $table) { 29 | $table->dropColumn('name'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_07_13_233642_add_name_to_games.php: -------------------------------------------------------------------------------- 1 | string('name')->unique()->after('id'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('games', function (Blueprint $table) { 29 | $table->dropColumn('name'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2022_07_13_234643_add_directory_name_to_platforms.php: -------------------------------------------------------------------------------- 1 | string('directory_name')->unique()->after('slug'); 18 | }); 19 | } 20 | 21 | /** 22 | * Reverse the migrations. 23 | * 24 | * @return void 25 | */ 26 | public function down() 27 | { 28 | Schema::table('platforms', function (Blueprint $table) { 29 | $table->dropColumn('directory_name'); 30 | }); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | insert([ 19 | 'name' => 'admin', 20 | 'password' => Hash::make('password'), 21 | 'is_admin' => true 22 | ]); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docker-compose.test.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | app: 4 | build: . 5 | ports: 6 | - '${APP_PORT:-80}:80' 7 | volumes: 8 | - '${GAMES_PATH}:/games:ro' 9 | - cartridge:/var/www/cartridge/storage 10 | networks: 11 | - cartridge 12 | depends_on: 13 | - mariadb 14 | - meilisearch 15 | db: 16 | image: 'mariadb:10' 17 | ports: 18 | - '${DB_PORT:-3306}:3306' 19 | environment: 20 | MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-cartridge}' 21 | MYSQL_ROOT_HOST: "%" 22 | MYSQL_DATABASE: '${DB_DATABASE:-cartridge}' 23 | MYSQL_USER: '${DB_USERNAME:-cartridge}' 24 | MYSQL_PASSWORD: '${DB_PASSWORD:-cartridge}' 25 | MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' 26 | volumes: 27 | - 'mariadb:/var/lib/mysql' 28 | networks: 29 | - cartridge 30 | healthcheck: 31 | test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD:-cartridge}"] 32 | retries: 3 33 | timeout: 5s 34 | meilisearch: 35 | image: 'getmeili/meilisearch:latest' 36 | ports: 37 | - '${MEILISEARCH_PORT:-7700}:7700' 38 | volumes: 39 | - 'meilisearch:/meili_data' 40 | networks: 41 | - cartridge 42 | healthcheck: 43 | test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"] 44 | retries: 3 45 | timeout: 5s 46 | networks: 47 | cartridge: 48 | driver: bridge 49 | volumes: 50 | cartridge: 51 | driver: local 52 | mariadb: 53 | driver: local 54 | meilisearch: 55 | driver: local 56 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # For more information: https://laravel.com/docs/sail 2 | version: '3' 3 | services: 4 | laravel.test: 5 | build: 6 | context: ./vendor/laravel/sail/runtimes/8.1 7 | dockerfile: Dockerfile 8 | args: 9 | WWWGROUP: '${APP_GID:-1000}' 10 | image: sail-8.1/app 11 | extra_hosts: 12 | - 'host.docker.internal:host-gateway' 13 | ports: 14 | - '${APP_PORT:-80}:80' 15 | - '${HMR_PORT:-8080}:8080' 16 | environment: 17 | WWWUSER: '${APP_UID:-1000}' 18 | LARAVEL_SAIL: 1 19 | XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}' 20 | XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}' 21 | volumes: 22 | - '.:/var/www/html' 23 | - '${GAMES_PATH}:/games:ro' 24 | networks: 25 | - sail 26 | depends_on: 27 | - mariadb 28 | - meilisearch 29 | db: 30 | image: 'mariadb:10' 31 | ports: 32 | - '${DB_PORT:-3306}:3306' 33 | environment: 34 | MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-cartridge}' 35 | MYSQL_ROOT_HOST: "%" 36 | MYSQL_DATABASE: '${DB_DATABASE:-cartridge}' 37 | MYSQL_USER: '${DB_USERNAME:-cartridge}' 38 | MYSQL_PASSWORD: '${DB_PASSWORD:-cartridge}' 39 | MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' 40 | volumes: 41 | - 'sail-mariadb:/var/lib/mysql' 42 | - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh' 43 | networks: 44 | - sail 45 | healthcheck: 46 | test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD:-cartridge}"] 47 | retries: 3 48 | timeout: 5s 49 | meilisearch: 50 | image: 'getmeili/meilisearch:latest' 51 | ports: 52 | - '${MEILISEARCH_PORT:-7700}:7700' 53 | volumes: 54 | - 'sail-meilisearch:/meili_data' 55 | networks: 56 | - sail 57 | healthcheck: 58 | test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"] 59 | retries: 3 60 | timeout: 5s 61 | adminer: 62 | image: adminer 63 | ports: 64 | - '${ADMINER_PORT:-8181}:8080' 65 | networks: 66 | - sail 67 | networks: 68 | sail: 69 | driver: bridge 70 | volumes: 71 | sail-mariadb: 72 | driver: local 73 | sail-meilisearch: 74 | driver: local 75 | -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background. 5 | # (also, when run as "apache2ctl ", it does not use "exec", which leaves an undesirable resident shell process) 6 | 7 | : "${APACHE_CONFDIR:=/etc/apache2}" 8 | : "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}" 9 | if test -f "$APACHE_ENVVARS"; then 10 | . "$APACHE_ENVVARS" 11 | fi 12 | 13 | export APACHE_RUN_USER=cartridge 14 | export APACHE_RUN_GROUP=cartridge 15 | 16 | # Apache gets grumpy about PID files pre-existing 17 | : "${APACHE_RUN_DIR:=/var/run/apache2}" 18 | : "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}" 19 | rm -f "$APACHE_PID_FILE" 20 | 21 | # create missing directories 22 | # (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR) 23 | for e in "${!APACHE_@}"; do 24 | if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then 25 | # handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir 26 | # mkdir: cannot create directory '/var/lock': File exists 27 | dir="${!e}" 28 | while [ "$dir" != "$(dirname "$dir")" ]; do 29 | dir="$(dirname "$dir")" 30 | if [ -d "$dir" ]; then 31 | break 32 | fi 33 | absDir="$(readlink -f "$dir" 2>/dev/null || :)" 34 | if [ -n "$absDir" ]; then 35 | mkdir -p "$absDir" 36 | fi 37 | done 38 | 39 | mkdir -p "${!e}" 40 | fi 41 | done 42 | 43 | exec apache2 -DFOREGROUND "$@" -------------------------------------------------------------------------------- /lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'accepted_if' => 'The :attribute must be accepted when :other is :value.', 18 | 'active_url' => 'The :attribute is not a valid URL.', 19 | 'after' => 'The :attribute must be a date after :date.', 20 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 21 | 'alpha' => 'The :attribute must only contain letters.', 22 | 'alpha_dash' => 'The :attribute must only contain letters, numbers, dashes and underscores.', 23 | 'alpha_num' => 'The :attribute must only contain letters and numbers.', 24 | 'array' => 'The :attribute must be an array.', 25 | 'before' => 'The :attribute must be a date before :date.', 26 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 27 | 'between' => [ 28 | 'array' => 'The :attribute must have between :min and :max items.', 29 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 30 | 'numeric' => 'The :attribute must be between :min and :max.', 31 | 'string' => 'The :attribute must be between :min and :max characters.', 32 | ], 33 | 'boolean' => 'The :attribute field must be true or false.', 34 | 'confirmed' => 'The :attribute confirmation does not match.', 35 | 'current_password' => 'The password is incorrect.', 36 | 'date' => 'The :attribute is not a valid date.', 37 | 'date_equals' => 'The :attribute must be a date equal to :date.', 38 | 'date_format' => 'The :attribute does not match the format :format.', 39 | 'declined' => 'The :attribute must be declined.', 40 | 'declined_if' => 'The :attribute must be declined when :other is :value.', 41 | 'different' => 'The :attribute and :other must be different.', 42 | 'digits' => 'The :attribute must be :digits digits.', 43 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 44 | 'dimensions' => 'The :attribute has invalid image dimensions.', 45 | 'distinct' => 'The :attribute field has a duplicate value.', 46 | 'email' => 'The :attribute must be a valid email address.', 47 | 'ends_with' => 'The :attribute must end with one of the following: :values.', 48 | 'enum' => 'The selected :attribute is invalid.', 49 | 'exists' => 'The selected :attribute is invalid.', 50 | 'file' => 'The :attribute must be a file.', 51 | 'filled' => 'The :attribute field must have a value.', 52 | 'gt' => [ 53 | 'array' => 'The :attribute must have more than :value items.', 54 | 'file' => 'The :attribute must be greater than :value kilobytes.', 55 | 'numeric' => 'The :attribute must be greater than :value.', 56 | 'string' => 'The :attribute must be greater than :value characters.', 57 | ], 58 | 'gte' => [ 59 | 'array' => 'The :attribute must have :value items or more.', 60 | 'file' => 'The :attribute must be greater than or equal to :value kilobytes.', 61 | 'numeric' => 'The :attribute must be greater than or equal to :value.', 62 | 'string' => 'The :attribute must be greater than or equal to :value characters.', 63 | ], 64 | 'image' => 'The :attribute must be an image.', 65 | 'in' => 'The selected :attribute is invalid.', 66 | 'in_array' => 'The :attribute field does not exist in :other.', 67 | 'integer' => 'The :attribute must be an integer.', 68 | 'ip' => 'The :attribute must be a valid IP address.', 69 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 70 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 71 | 'json' => 'The :attribute must be a valid JSON string.', 72 | 'lt' => [ 73 | 'array' => 'The :attribute must have less than :value items.', 74 | 'file' => 'The :attribute must be less than :value kilobytes.', 75 | 'numeric' => 'The :attribute must be less than :value.', 76 | 'string' => 'The :attribute must be less than :value characters.', 77 | ], 78 | 'lte' => [ 79 | 'array' => 'The :attribute must not have more than :value items.', 80 | 'file' => 'The :attribute must be less than or equal to :value kilobytes.', 81 | 'numeric' => 'The :attribute must be less than or equal to :value.', 82 | 'string' => 'The :attribute must be less than or equal to :value characters.', 83 | ], 84 | 'mac_address' => 'The :attribute must be a valid MAC address.', 85 | 'max' => [ 86 | 'array' => 'The :attribute must not have more than :max items.', 87 | 'file' => 'The :attribute must not be greater than :max kilobytes.', 88 | 'numeric' => 'The :attribute must not be greater than :max.', 89 | 'string' => 'The :attribute must not be greater than :max characters.', 90 | ], 91 | 'mimes' => 'The :attribute must be a file of type: :values.', 92 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 93 | 'min' => [ 94 | 'array' => 'The :attribute must have at least :min items.', 95 | 'file' => 'The :attribute must be at least :min kilobytes.', 96 | 'numeric' => 'The :attribute must be at least :min.', 97 | 'string' => 'The :attribute must be at least :min characters.', 98 | ], 99 | 'multiple_of' => 'The :attribute must be a multiple of :value.', 100 | 'not_in' => 'The selected :attribute is invalid.', 101 | 'not_regex' => 'The :attribute format is invalid.', 102 | 'numeric' => 'The :attribute must be a number.', 103 | 'password' => [ 104 | 'letters' => 'The :attribute must contain at least one letter.', 105 | 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', 106 | 'numbers' => 'The :attribute must contain at least one number.', 107 | 'symbols' => 'The :attribute must contain at least one symbol.', 108 | 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', 109 | ], 110 | 'present' => 'The :attribute field must be present.', 111 | 'prohibited' => 'The :attribute field is prohibited.', 112 | 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', 113 | 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', 114 | 'prohibits' => 'The :attribute field prohibits :other from being present.', 115 | 'regex' => 'The :attribute format is invalid.', 116 | 'required' => 'The :attribute field is required.', 117 | 'required_array_keys' => 'The :attribute field must contain entries for: :values.', 118 | 'required_if' => 'The :attribute field is required when :other is :value.', 119 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 120 | 'required_with' => 'The :attribute field is required when :values is present.', 121 | 'required_with_all' => 'The :attribute field is required when :values are present.', 122 | 'required_without' => 'The :attribute field is required when :values is not present.', 123 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 124 | 'same' => 'The :attribute and :other must match.', 125 | 'size' => [ 126 | 'array' => 'The :attribute must contain :size items.', 127 | 'file' => 'The :attribute must be :size kilobytes.', 128 | 'numeric' => 'The :attribute must be :size.', 129 | 'string' => 'The :attribute must be :size characters.', 130 | ], 131 | 'starts_with' => 'The :attribute must start with one of the following: :values.', 132 | 'string' => 'The :attribute must be a string.', 133 | 'timezone' => 'The :attribute must be a valid timezone.', 134 | 'unique' => 'The :attribute has already been taken.', 135 | 'uploaded' => 'The :attribute failed to upload.', 136 | 'url' => 'The :attribute must be a valid URL.', 137 | 'uuid' => 'The :attribute must be a valid UUID.', 138 | 139 | /* 140 | |-------------------------------------------------------------------------- 141 | | Custom Validation Language Lines 142 | |-------------------------------------------------------------------------- 143 | | 144 | | Here you may specify custom validation messages for attributes using the 145 | | convention "attribute.rule" to name the lines. This makes it quick to 146 | | specify a specific custom language line for a given attribute rule. 147 | | 148 | */ 149 | 150 | 'custom' => [ 151 | 'attribute-name' => [ 152 | 'rule-name' => 'custom-message', 153 | ], 154 | ], 155 | 156 | /* 157 | |-------------------------------------------------------------------------- 158 | | Custom Validation Attributes 159 | |-------------------------------------------------------------------------- 160 | | 161 | | The following language lines are used to swap our attribute placeholder 162 | | with something more reader friendly such as "E-Mail Address" instead 163 | | of "email". This simply helps us make our message more expressive. 164 | | 165 | */ 166 | 167 | 'attributes' => [], 168 | 169 | ]; 170 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "mix --production", 5 | "watch": "mix watch --hot", 6 | "docker:build": "docker build -t cartridge:test . --progress plain | tee docker-build.log", 7 | "docker:test": "npm run docker:build && docker run --rm -i -t cartridge:test bash" 8 | }, 9 | "devDependencies": { 10 | "@fontsource/poppins": "^4.5.8", 11 | "axios": "^0.25", 12 | "chalk": "^4.1.2", 13 | "dotenv": "^16.0.1", 14 | "feather-icons": "^4.29.0", 15 | "laravel-mix": "^6.0.6", 16 | "normalize.css": "^8.0.1", 17 | "resolve-url-loader": "^3.1.2", 18 | "sanitize-html": "^2.7.0", 19 | "sass": "^1.32.11", 20 | "sass-loader": "^11.0.1", 21 | "vue": "^2.6.12", 22 | "vue-feather": "^1.1.1", 23 | "vue-inline-svg": "^2.1.0", 24 | "vue-loader": "^15.9.8", 25 | "vue-router": "^3.5.4", 26 | "vue-template-compiler": "^2.6.12" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | 4 | // Inline SVG component 5 | import InlineSvg from 'vue-inline-svg' 6 | Vue.component('inline-svg', InlineSvg) 7 | 8 | // Import axios 9 | Vue.prototype.$axios = require('axios') 10 | Vue.prototype.$axios.defaults.headers.common['X-Requested-With'] = 11 | 'XMLHttpRequest' 12 | 13 | // Get CSRF token 14 | window.csrfToken = document.querySelector('meta[name="csrf-token"]').content 15 | 16 | // Routes 17 | Vue.use(VueRouter) 18 | import routes from './routes' 19 | const router = new VueRouter({ 20 | routes, 21 | }) 22 | 23 | // Import all Vue components 24 | const files = require.context('./', true, /\.vue$/i) 25 | files 26 | .keys() 27 | .map((key) => 28 | Vue.component(key.split('/').pop().split('.')[0], files(key).default) 29 | ) 30 | 31 | // Create Vue app 32 | const app = new Vue({ 33 | router, 34 | }).$mount('#app') 35 | -------------------------------------------------------------------------------- /resources/js/components/AppLogo.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 38 | -------------------------------------------------------------------------------- /resources/js/components/CsrfToken.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 14 | -------------------------------------------------------------------------------- /resources/js/components/GameList.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 28 | 29 | 94 | -------------------------------------------------------------------------------- /resources/js/components/Icon.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 26 | 27 | 39 | -------------------------------------------------------------------------------- /resources/js/components/LoadingAnimation.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 33 | -------------------------------------------------------------------------------- /resources/js/components/NavBar.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 64 | 65 | 202 | -------------------------------------------------------------------------------- /resources/js/components/NotFound.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /resources/js/routes.js: -------------------------------------------------------------------------------- 1 | // Route views 2 | import LibraryView from './views/LibraryView' 3 | import SearchView from './views/SearchView' 4 | import GameView from './views/GameView' 5 | 6 | // Routes 7 | export default [ 8 | { 9 | path: '/', 10 | component: LibraryView, 11 | name: 'library', 12 | }, 13 | { 14 | path: '/search/:query', 15 | component: SearchView, 16 | name: 'search', 17 | }, 18 | { 19 | path: '/games/:slug', 20 | component: GameView, 21 | name: 'game', 22 | }, 23 | ] 24 | -------------------------------------------------------------------------------- /resources/js/views/GameView.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 88 | 89 | 160 | -------------------------------------------------------------------------------- /resources/js/views/LibraryView.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 34 | 35 | 47 | -------------------------------------------------------------------------------- /resources/js/views/SearchView.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 39 | 40 | 52 | -------------------------------------------------------------------------------- /resources/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | $black: hsl(0, 0%, 4%); 2 | $black-light: hsl(0, 0%, 7%); 3 | $black-lighter: hsl(0, 0%, 14%); 4 | 5 | $white: hsl(0, 0%, 100%); 6 | $white-dark: hsl(0, 0%, 98%); 7 | $white-darker: hsl(0, 0%, 96%); 8 | 9 | $grey-darker: hsl(0, 0%, 21%); 10 | $grey-dark: hsl(0, 0%, 29%); 11 | $grey: hsl(0, 0%, 48%); 12 | $grey-light: hsl(0, 0%, 71%); 13 | $grey-lighter: hsl(0, 0%, 86%); 14 | 15 | $orange: hsl(14, 100%, 53%); 16 | $yellow: hsl(44, 100%, 77%); 17 | $green: hsl(153, 53%, 53%); 18 | $turquoise: hsl(171, 100%, 41%); 19 | $cyan: hsl(207, 61%, 53%); 20 | $blue: hsl(229, 53%, 53%); 21 | $purple: hsl(271, 100%, 71%); 22 | $red: hsl(348, 86%, 61%); 23 | 24 | $primary: hsl(246, 97%, 66%); 25 | $secondary: hsl(271, 100%, 71%); 26 | 27 | $danger: $red; 28 | $success: $green; 29 | $warning: $yellow; 30 | $info: $blue; 31 | 32 | $main-background: $black-lighter; 33 | $main-foreground: $white; 34 | 35 | $fancy-gradient: linear-gradient( 36 | 25deg, 37 | rgba(102, 86, 252, 1) 0%, 38 | rgba(102, 86, 252, 1) 10%, 39 | rgba(147, 86, 252, 1) 50%, 40 | rgba(204, 84, 247, 1) 100% 41 | ); 42 | 43 | $font-main: 'Poppins', 'Lato', 'Segoe UI', Candara, 'Bitstream Vera Sans', 44 | 'DejaVu Sans', 'Bitstream Vera Sans', 'Trebuchet MS', Verdana, 'Verdana Ref', 45 | sans-serif; 46 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | @import '~normalize.css'; 2 | @import '~@fontsource/poppins/400.css'; // Normal 3 | @import '~@fontsource/poppins/800.css'; // Bold 4 | 5 | :root { 6 | color-scheme: dark; 7 | } 8 | 9 | ::selection { 10 | background: $primary; 11 | color: $white; 12 | } 13 | 14 | * { 15 | position: relative; 16 | box-sizing: border-box; 17 | margin: initial; 18 | padding: initial; 19 | } 20 | 21 | html { 22 | height: 100%; 23 | } 24 | 25 | body { 26 | min-height: 100%; 27 | font-family: $font-main; 28 | font-size: normal; 29 | line-height: 1; 30 | background-color: $main-background; 31 | color: $main-foreground; 32 | } 33 | 34 | h1, 35 | h2, 36 | h3, 37 | h4, 38 | h5, 39 | h6 { 40 | font-size: initial; 41 | margin: initial; 42 | font-weight: normal; 43 | } 44 | 45 | a { 46 | text-decoration: none; 47 | color: currentColor; 48 | } 49 | 50 | // Non-layout content 51 | .content { 52 | line-height: 1.6; 53 | 54 | h1, 55 | h2, 56 | h3, 57 | h4, 58 | h5, 59 | h6 { 60 | } 61 | 62 | h1 { 63 | font-size: 3em; 64 | } 65 | 66 | h2 { 67 | font-size: 2.5em; 68 | } 69 | 70 | h3 { 71 | font-size: 2em; 72 | } 73 | 74 | h4 { 75 | font-size: 1.75em; 76 | } 77 | 78 | h5 { 79 | font-size: 1.5em; 80 | } 81 | 82 | h6 { 83 | font-size: 1.25em; 84 | } 85 | 86 | a { 87 | color: $primary; 88 | 89 | &:visited { 90 | color: $secondary; 91 | } 92 | 93 | &:hover { 94 | text-decoration: underline; 95 | } 96 | } 97 | } 98 | 99 | input, 100 | button { 101 | outline: none; 102 | border: none; 103 | margin: initial; 104 | padding: initial; 105 | background: none; 106 | display: inline; 107 | line-height: 1; 108 | } 109 | 110 | .flex-table { 111 | $border-radius: 0.3em; 112 | $background-color: hsl(0%, 0%, 10%); 113 | $border-color: lighten($background-color, 5%); 114 | 115 | box-shadow: 0 0.1em 0.8em transparentize($black, 0.75); 116 | border: 1px solid $border-color; 117 | border-radius: $border-radius; 118 | background-color: $background-color; 119 | 120 | .flex-table-header { 121 | .flex-table-row { 122 | background-color: lighten($background-color, 14%); 123 | 124 | &:first-child { 125 | border-radius: $border-radius $border-radius 0 0; 126 | } 127 | } 128 | } 129 | 130 | .flex-table-body { 131 | .flex-table-row { 132 | background-color: $background-color; 133 | 134 | &:nth-child(odd) { 135 | background-color: darken($background-color, 1%); 136 | } 137 | 138 | &:last-child { 139 | border-radius: 0 0 $border-radius $border-radius; 140 | } 141 | 142 | &:hover { 143 | background-color: transparentize($white, 0.99); 144 | } 145 | } 146 | } 147 | 148 | .flex-table-row { 149 | display: flex; 150 | flex-direction: row; 151 | 152 | &:not(:last-child) { 153 | border-bottom: 1px solid $border-color; 154 | } 155 | } 156 | 157 | .flex-table-cell, 158 | .flex-table-heading { 159 | flex: 0 0 20%; 160 | padding: 0.7em; 161 | display: flex; 162 | align-items: center; 163 | 164 | &:not(:last-child) { 165 | border-right: 1px solid $border-color; 166 | } 167 | 168 | &.is-smaller { 169 | flex: 0 0 5%; 170 | } 171 | 172 | &.table-controls { 173 | flex: 1 1 auto; 174 | justify-content: flex-end; 175 | align-items: center; 176 | 177 | &> *:not(:last-child) { 178 | margin-right: 0.25em; 179 | } 180 | } 181 | } 182 | } 183 | 184 | .table { 185 | display: table; 186 | flex-direction: column; 187 | border-collapse: collapse; 188 | background-color: $grey-darker; 189 | border-radius: 0.4em; 190 | 191 | &.is-full-width { 192 | width: 100%; 193 | } 194 | 195 | td, 196 | th { 197 | text-align: left; 198 | vertical-align: middle; 199 | padding: 0.6em; 200 | 201 | &:not(.options) { 202 | width: 100px; 203 | } 204 | } 205 | 206 | th { 207 | font-weight: normal; 208 | } 209 | 210 | tbody { 211 | tr { 212 | background-color: darken($black-lighter, 5%); 213 | } 214 | 215 | tr:nth-child(even) { 216 | background-color: darken($black-lighter, 7%); 217 | } 218 | 219 | td { 220 | border-radius: 0.4em; 221 | } 222 | } 223 | } 224 | 225 | .title { 226 | font-size: 2em; 227 | } 228 | 229 | .container { 230 | padding: 1rem; 231 | } 232 | 233 | #app { 234 | width: 100%; 235 | height: 100vh; 236 | display: flex; 237 | flex-direction: column; 238 | background-color: $black; 239 | 240 | & > main { 241 | flex: 1 1 auto; 242 | } 243 | } 244 | 245 | #admin-panel { 246 | background-color: $main-background; 247 | $panel-padding: 2rem; 248 | 249 | width: 100%; 250 | height: 100%; 251 | display: flex; 252 | flex-direction: row; 253 | 254 | #menu { 255 | padding: $panel-padding; 256 | flex: 0 0 15%; 257 | min-width: 250px; 258 | background-color: $black-light; 259 | 260 | .logo { 261 | width: 100%; 262 | margin-bottom: 2em; 263 | 264 | & > a { 265 | display: block; 266 | width: 100%; 267 | height: 100%; 268 | transition: filter 0.5s ease-in-out; 269 | 270 | &:hover { 271 | filter: drop-shadow( 272 | 0 0.01em 1em transparentize($secondary, 0.5) 273 | ); 274 | } 275 | } 276 | 277 | img { 278 | display: block; 279 | width: 100%; 280 | height: auto; 281 | } 282 | } 283 | 284 | .button { 285 | background-color: $grey-darker; 286 | transition: text-shadow 0.5s ease-in-out, 287 | box-shadow 0.5s ease-in-out; 288 | 289 | &:not(:last-child) { 290 | margin-bottom: 0.4em; 291 | } 292 | 293 | &:hover { 294 | z-index: 1; 295 | background-color: $primary; 296 | box-shadow: 0 0.01em 2em transparentize($secondary, 0.7); 297 | text-shadow: 0 0.01em 1em transparentize($white, 0.5); 298 | 299 | & > a { 300 | color: $white; 301 | background-color: transparent; 302 | } 303 | } 304 | } 305 | } 306 | 307 | main { 308 | .page-title { 309 | background: $grey-darker; 310 | padding: $panel-padding; 311 | } 312 | 313 | .page-content { 314 | padding: $panel-padding; 315 | } 316 | 317 | flex: 1 1 auto; 318 | overflow-y: auto; 319 | } 320 | } 321 | 322 | .fade-enter-active, 323 | .fade-leave-active { 324 | transition: opacity 0.2s; 325 | } 326 | 327 | .fade-enter, 328 | .fade-leave-to { 329 | opacity: 0; 330 | } 331 | 332 | .is-full-size { 333 | width: 100%; 334 | height: 100%; 335 | } 336 | 337 | .columns { 338 | width: 100%; 339 | display: flex; 340 | flex-direction: row; 341 | 342 | & > .column { 343 | flex: 1 1 auto; 344 | 345 | & > .is-one-quarter { 346 | flex: 1 1 25%; 347 | } 348 | 349 | & > .is-one-half { 350 | flex: 1 1 50%; 351 | } 352 | 353 | & > .is-one-third { 354 | flex: 1 1 33.333%; 355 | } 356 | } 357 | } 358 | 359 | .buttons { 360 | display: flex; 361 | flex-direction: row; 362 | align-items: center; 363 | 364 | & > .button { 365 | flex: 0 0 auto; 366 | display: flex; 367 | height: 100%; 368 | 369 | &:not(:last-child) { 370 | margin-right: 0.5em; 371 | } 372 | } 373 | } 374 | 375 | .button { 376 | cursor: pointer; 377 | display: inline-flex; 378 | align-items: center; 379 | justify-content: center; 380 | padding: 0.75em 1em; 381 | color: $white; 382 | background-color: $primary; 383 | border-radius: 0.2em; 384 | transition: background-color 0.1s ease; 385 | transform: scale(1); 386 | 387 | & > .icon:not(:last-child) { 388 | margin-right: 0.3em; 389 | } 390 | 391 | &.is-small { 392 | padding: 0.4em; 393 | } 394 | 395 | &.is-full-width { 396 | display: flex; 397 | justify-content: flex-start; 398 | width: 100%; 399 | text-align: center; 400 | } 401 | 402 | &:hover { 403 | background-color: darken($primary, 3%); 404 | } 405 | 406 | &.is-link { 407 | background-color: transparent; 408 | 409 | &:hover { 410 | background-color: $grey-darker; 411 | } 412 | } 413 | 414 | &.is-danger { 415 | background-color: $danger; 416 | color: $white; 417 | 418 | &:hover { 419 | background-color: darken($danger, 3%); 420 | } 421 | } 422 | 423 | &.is-disabled, &:disabled { 424 | background-color: $grey-darker; 425 | color: $grey-light; 426 | cursor: not-allowed; 427 | 428 | &:hover { 429 | background-color: $grey-darker; 430 | } 431 | } 432 | } 433 | 434 | .form { 435 | } 436 | 437 | .field { 438 | max-width: 300px; 439 | width: 100%; 440 | padding: 0.25em; 441 | 442 | &.is-inline { 443 | display: flex; 444 | flex-direction: row; 445 | align-items: center; 446 | } 447 | 448 | &.has-toggle { 449 | @extend .is-inline; 450 | justify-content: space-between; 451 | } 452 | 453 | &:not(:last-child) { 454 | padding-bottom: 0.8em; 455 | border-bottom: 0.02em solid lighten($main-background, 4%); 456 | margin-bottom: 0.8em; 457 | } 458 | 459 | .label { 460 | color: $white-darker; 461 | display: block; 462 | margin-bottom: 0.4em; 463 | padding-left: 0.1em; 464 | letter-spacing: 0.02em; 465 | } 466 | 467 | .input { 468 | width: 100%; 469 | display: block; 470 | background-color: $grey-darker; 471 | padding: 0.4em 0.6em; 472 | border-radius: 0.2em; 473 | border: 0.15em solid transparent; 474 | transition: all 0.1s ease; 475 | color: $grey-light; 476 | 477 | &:focus { 478 | color: $white; 479 | border-color: $primary; 480 | } 481 | } 482 | } 483 | 484 | .flashes { 485 | position: fixed; 486 | bottom: 1em; 487 | width: 100%; 488 | z-index: 50; 489 | margin: 0 auto; 490 | display: flex; 491 | flex-direction: column; 492 | align-items: center; 493 | justify-content: center; 494 | } 495 | 496 | .alert { 497 | background-color: $grey-dark; 498 | color: $white; 499 | padding: 1em; 500 | flex: 1 1 auto; 501 | width: 400px; 502 | max-width: 100%; 503 | border-radius: 0.2em; 504 | display: flex; 505 | flex-direction: row; 506 | align-items: center; 507 | 508 | &.is-danger, 509 | &.is-error { 510 | background-color: $danger; 511 | color: $white; 512 | } 513 | } 514 | 515 | .page-controls { 516 | margin-bottom: 1em; 517 | } 518 | 519 | .toggle { 520 | $transition-speed: 0.3s; 521 | $border-radius: 1em; 522 | $width: 40px; 523 | $height: 20px; 524 | $padding: 4px; 525 | 526 | $handle-size: $height - ($padding * 2); 527 | 528 | display: inline-block; 529 | width: $width; 530 | height: $height; 531 | cursor: not-allowed; 532 | 533 | input { 534 | opacity: 0; 535 | width: 0; 536 | height: 0; 537 | } 538 | 539 | .toggle-slider { 540 | border-radius: $border-radius; 541 | transition: $transition-speed; 542 | position: absolute; 543 | top: 0; 544 | left: 0; 545 | right: 0; 546 | bottom: 0; 547 | background-color: $grey-darker; 548 | 549 | &:before { 550 | border-radius: $border-radius; 551 | transition: $transition-speed; 552 | position: absolute; 553 | content: ""; 554 | height: $handle-size; 555 | width: $handle-size; 556 | left: $padding; 557 | bottom: $padding; 558 | background-color: $grey-dark; 559 | } 560 | } 561 | 562 | &:not(.is-disabled) { 563 | cursor: pointer; 564 | 565 | input { 566 | &:checked + .toggle-slider { 567 | background-color: $primary; 568 | } 569 | 570 | &:checked + .toggle-slider:before { 571 | transform: translateX($width - ($padding * 2) - $handle-size); 572 | background-color: $white; 573 | } 574 | } 575 | 576 | .toggle-slider { 577 | background-color: $grey-darker; 578 | 579 | &:before { 580 | background-color: $grey-light; 581 | } 582 | } 583 | } 584 | } -------------------------------------------------------------------------------- /resources/views/admin/dashboard.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | 3 | @section('admin-content') 4 | Hello! 5 | @endsection 6 | -------------------------------------------------------------------------------- /resources/views/admin/platforms/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | 3 | @section('admin-content') 4 |
5 |

Platforms

6 |
7 | 8 |
9 |
10 |
11 | 12 | New 13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 | ID 22 |
23 |
24 | Name 25 |
26 |
27 | IGDB Slug 28 |
29 |
30 | Directory 31 |
32 |
33 | 34 |
35 |
36 |
37 | 38 |
39 | @foreach ($platforms as $platform) 40 |
41 |
42 | {{ $platform->id }} 43 |
44 |
45 | {{ $platform->name }} 46 |
47 |
48 | {{ $platform->slug }} 49 |
50 |
51 | /{{ $platform->directory_name }} 52 |
53 |
54 | 55 | 56 | 57 | 58 |
59 | @csrf 60 | @method('DELETE') 61 | 62 |
63 |
64 |
65 | @endforeach 66 |
67 |
68 |
69 | @endsection 70 | -------------------------------------------------------------------------------- /resources/views/admin/platforms/modify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | 3 | @section('admin-content') 4 |
5 | @if($is_edit_mode) 6 |

Edit {{ $platform->name }}

7 | @else 8 |

New Platform

9 | @endif 10 |
11 | 12 |
13 | @if ($errors->any()) 14 |
15 |
    16 | @foreach ($errors->all() as $error) 17 |
  • {{ $error }}
  • 18 | @endforeach 19 |
20 |
21 | @endif 22 | 23 |
24 | @csrf 25 | @method($is_edit_mode ? 'PATCH' : 'POST') 26 | 27 | 28 | 29 | 30 | 31 |
32 | 35 | Cancel 36 |
37 | 38 |
39 | @endsection 40 | -------------------------------------------------------------------------------- /resources/views/admin/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | 3 | @section('admin-content') 4 |
5 |

Users

6 |
7 | 8 |
9 |
10 |
11 | 12 | New 13 | 14 |
15 |
16 | 17 |
18 |
19 |
20 |
21 | ID 22 |
23 |
24 | Username 25 |
26 |
27 | Role 28 |
29 |
30 | 31 |
32 |
33 |
34 | 35 |
36 | @foreach ($users as $user) 37 |
38 |
39 | {{ $user->id }} 40 |
41 |
42 | {{ $user->name }} 43 |
44 |
45 | {{ $user->is_admin ? "Admin" : "User" }} 46 |
47 |
48 | 49 | 50 | 51 | 52 |
53 | @csrf 54 | @method('DELETE') 55 | 56 |
57 |
58 |
59 | @endforeach 60 |
61 |
62 |
63 | @endsection 64 | -------------------------------------------------------------------------------- /resources/views/admin/users/modify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | 3 | @section('admin-content') 4 |
5 | @if($is_edit_mode) 6 |

Edit {{ $user->name }}

7 | @else 8 |

New User

9 | @endif 10 |
11 | 12 |
13 | @if ($errors->any()) 14 |
15 |
    16 | @foreach ($errors->all() as $error) 17 |
  • {{ $error }}
  • 18 | @endforeach 19 |
20 |
21 | @endif 22 | 23 |
24 | @csrf 25 | @method($is_edit_mode ? 'PATCH' : 'POST') 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 | 37 | Cancel 38 |
39 | 40 |
41 | @endsection 42 | -------------------------------------------------------------------------------- /resources/views/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Login') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('name') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('password') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 | 60 | @if (Route::has('password.request')) 61 | 62 | {{ __('Forgot Your Password?') }} 63 | 64 | @endif 65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | @endsection 74 | -------------------------------------------------------------------------------- /resources/views/components/flash.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{ $request }} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/components/forms/radio-input.blade.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/views/components/forms/text-input.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'type' => 'text', 3 | 'value' => '', 4 | 'placeholder' => '', 5 | 'label' => '', 6 | 'name' => '' 7 | ]) 8 | 9 |
10 | @if ($label !== '') 11 | 12 | @endif 13 | 14 | 15 |
16 | -------------------------------------------------------------------------------- /resources/views/components/forms/toggle-input.blade.php: -------------------------------------------------------------------------------- 1 | @props([ 2 | 'value' => '', 3 | 'label' => '', 4 | 'name' => '', 5 | 'is_checked' => false, 6 | 'is_disabled' => false 7 | ]) 8 | 9 |
10 | @if ($label !== '') 11 |
{{ $label }}
12 | @endif 13 | 19 |
20 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | 5 |
6 | 7 |
8 | @endsection 9 | -------------------------------------------------------------------------------- /resources/views/layouts/admin.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 | 35 | 36 |
37 | @yield('admin-content') 38 |
39 | 40 | @php 41 | $status = session()->get('status'); 42 | @endphp 43 | 44 | @if($status) 45 |
46 |
47 |

{{ $status['message'] }}

48 |
49 |
50 | @endif 51 |
52 | 53 | @endsection 54 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Cartridge 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | @yield('content') 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 10 | return $request->user(); 11 | }); 12 | 13 | // Games 14 | Route::get('/games', [GameController::class, 'index']); 15 | Route::get('/games/search/{query}', [GameController::class, 'search']); 16 | Route::get('/games/{slug}', [GameController::class, 'show']); 17 | 18 | // Platforms 19 | Route::get('/platforms', [PlatformController::class, 'index']); 20 | Route::get('/platforms/search/{query}', [PlatformController::class, 'search']); 21 | Route::get('/platforms/{slug}', [PlatformController::class, 'show']); 22 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('login'); 7 | Route::post('login', [LoginController::class, 'login']); 8 | Route::post('logout', [LoginController::class, 'logout'])->name('logout'); 9 | 10 | Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); 11 | 12 | Route::middleware('auth')->group(function () { 13 | Route::get('/files/{id}/{filename}', [App\Http\Controllers\FileController::class, 'download'])->name('download'); 14 | }); 15 | 16 | Route::prefix('admin')->group(function () { 17 | Route::view('/', 'admin.dashboard'); 18 | 19 | Route::resource('users', App\Http\Controllers\Admin\UsersController::class); 20 | Route::resource('platforms', App\Http\Controllers\Admin\PlatformsController::class); 21 | }); 22 | -------------------------------------------------------------------------------- /static/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamjnsn/cartridge-legacy/69eacb769f79bbbbc3f4b1037e3f8a3ad1f4b2bf/static/favicon.ico -------------------------------------------------------------------------------- /static/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /static/icons/slash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/icons/x.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /static/images/logo-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jamjnsn/cartridge-legacy/69eacb769f79bbbbc3f4b1037e3f8a3ad1f4b2bf/static/images/logo-full.png -------------------------------------------------------------------------------- /static/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix') 2 | const path = require('path') 3 | 4 | mix.webpackConfig({ 5 | resolve: { 6 | alias: { 7 | '@': path.resolve('resources/sass'), 8 | }, 9 | }, 10 | module: { 11 | rules: [ 12 | { 13 | test: /\.scss$/, 14 | loader: 'sass-loader', 15 | options: { 16 | additionalData: ` 17 | @import "~@/_variables.scss"; 18 | `, 19 | }, 20 | }, 21 | ], 22 | }, 23 | }) 24 | 25 | mix.options({ 26 | hmrOptions: { 27 | host: '0.0.0.0', 28 | port: 8080 29 | }, 30 | }) 31 | 32 | mix.copy('static', 'public') 33 | 34 | mix.js('resources/js/app.js', 'public') 35 | .sass('resources/sass/app.scss', 'public') 36 | .vue() 37 | .sourceMaps() 38 | .version() 39 | --------------------------------------------------------------------------------