Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Oct 20, 2023
2 parents 9203967 + d80b5da commit 40739c9
Show file tree
Hide file tree
Showing 771 changed files with 84,597 additions and 34,091 deletions.
6 changes: 6 additions & 0 deletions .bladeformatterrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"indentSize": 4,
"wrapLineLength": 250,
"endWithNewLine": true,
"useTabs": false
}
1 change: 1 addition & 0 deletions .bladeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/*
30 changes: 30 additions & 0 deletions .github/workflows/format_blade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Format (Blade)

on:
push:
branches:
- '**'

jobs:
blade-formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'

- name: Install packages
run: npm install

- name: Run blade-formatter
run: npm run format

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'refactor: fix blade formatting'
27 changes: 27 additions & 0 deletions .github/workflows/format_php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Format (PHP)

on:
push:
branches:
- '**'

jobs:
pint:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.1'
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Install
run: composer install

- name: Run pint
run: composer lint

- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'refactor: fix PHP styling'
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
/composer.lock
*.env
/composer.phar
*.cache
73 changes: 39 additions & 34 deletions app/Console/Commands/AddSiteSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;

use DB;
use Illuminate\Console\Command;

class AddSiteSettings extends Command
{
class AddSiteSettings extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -24,45 +22,17 @@ class AddSiteSettings extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

/**
* Add a site setting.
*
* Example usage:
* $this->addSiteSetting("site_setting_key", 1, "0: does nothing. 1: does something.");
*
* @param string $key
* @param int $value
* @param string $description
*/
private function addSiteSetting($key, $value, $description) {
if(!DB::table('site_settings')->where('key', $key)->exists()) {
DB::table('site_settings')->insert([
[
'key' => $key,
'value' => $value,
'description' => $description,
],
]);
$this->info( "Added: ".$key." / Default: ".$value);
}
else $this->line("Skipped: ".$key);
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
public function handle() {
$this->info('*********************');
$this->info('* ADD SITE SETTINGS *');
$this->info('*********************'."\n");
Expand Down Expand Up @@ -111,6 +81,41 @@ public function handle()

$this->addSiteSetting('shop_type', 0, '0: Default, 1: Collapsible.');

$this->addSiteSetting('is_maintenance_mode', 0, '0: Site is normal, 1: Users without the Has Maintenance Access power will be redirected to the home page.');

$this->addSiteSetting('deactivated_privacy', 0, 'Who can view the deactivated list? 0: Admin only, 1: Staff only, 2: Members only, 3: Public.');

$this->addSiteSetting('deactivated_link', 0, '0: No link to the deactivated list is displayed anywhere, 1: Link to the deactivated list is shown on the user list.');

$this->addSiteSetting('deactivated_key', 0, 'Optional key to view the deactivated list. Enter "0" to not require one.');

$this->addSiteSetting('comment_dislikes_enabled', 0, '0: Dislikes disabled, 1: Dislikes enabled.');

$this->line("\nSite settings up to date!");
}

/**
* Add a site setting.
*
* Example usage:
* $this->addSiteSetting("site_setting_key", 1, "0: does nothing. 1: does something.");
*
* @param string $key
* @param int $value
* @param string $description
*/
private function addSiteSetting($key, $value, $description) {
if (!DB::table('site_settings')->where('key', $key)->exists()) {
DB::table('site_settings')->insert([
[
'key' => $key,
'value' => $value,
'description' => $description,
],
]);
$this->info('Added: '.$key.' / Default: '.$value);
} else {
$this->line('Skipped: '.$key);
}
}
}
37 changes: 16 additions & 21 deletions app/Console/Commands/AddTextPages.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Carbon\Carbon;
use Config;
use DB;
use Carbon\Carbon;
use Illuminate\Console\Command;

class AddTextPages extends Command
{
class AddTextPages extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -25,11 +24,8 @@ class AddTextPages extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -38,34 +34,33 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
$pages = Config::get('lorekeeper.text_pages');


$this->info('******************');
$this->info('* ADD SITE PAGES *');
$this->info('******************'."\n");

$this->line("Adding site pages...existing entries will be skipped.\n");

foreach($pages as $key => $page) {
if(!DB::table('site_pages')->where('key', $key)->exists()) {
foreach ($pages as $key => $page) {
if (!DB::table('site_pages')->where('key', $key)->exists()) {
DB::table('site_pages')->insert([
[
'key' => $key,
'title' => $page['title'],
'text' => $page['text'],
'key' => $key,
'title' => $page['title'],
'text' => $page['text'],
'parsed_text' => $page['text'],
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
],

]);
$this->info("Added: ".$page['title']);
$this->info('Added: '.$page['title']);
} else {
$this->line('Skipped: '.$page['title']);
}
else $this->line("Skipped: ".$page['title']);
}
}
}
13 changes: 4 additions & 9 deletions app/Console/Commands/CheckNews.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\NewsService;
use Illuminate\Console\Command;

class CheckNews extends Command
{
class CheckNews extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class CheckNews extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,8 +32,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
(new NewsService)->updateQueue();
}
Expand Down
13 changes: 4 additions & 9 deletions app/Console/Commands/CheckSales.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\SalesService;
use Illuminate\Console\Command;

class CheckSales extends Command
{
class CheckSales extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -23,11 +22,8 @@ class CheckSales extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -36,8 +32,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
//
(new SalesService)->updateQueue();
}
Expand Down
17 changes: 5 additions & 12 deletions app/Console/Commands/ClearDeletedCharacterAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace App\Console\Commands;

use Illuminate\Console\Command;

use DB;

use App\Models\Character\Character;
use App\Models\Character\CharacterCurrency;
use App\Models\Character\CharacterFeature;
use App\Models\Character\CharacterImage;
use DB;
use Illuminate\Console\Command;

class ClearDeletedCharacterAttachments extends Command
{
class ClearDeletedCharacterAttachments extends Command {
/**
* The name and signature of the console command.
*
Expand All @@ -29,11 +26,8 @@ class ClearDeletedCharacterAttachments extends Command

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
public function __construct() {
parent::__construct();
}

Expand All @@ -42,8 +36,7 @@ public function __construct()
*
* @return mixed
*/
public function handle()
{
public function handle() {
// Get deleted character IDs
$deletedCharacterIds = DB::table('characters')->whereNotNull('deleted_at')->pluck('id');

Expand Down
Loading

0 comments on commit 40739c9

Please sign in to comment.