Skip to content

Commit

Permalink
because of various cleanup feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mlantz committed Apr 24, 2024
1 parent 7b72fc4 commit 6a343b4
Show file tree
Hide file tree
Showing 15 changed files with 33,818 additions and 28,833 deletions.
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ protected function schedule(Schedule $schedule)
->runInBackground()
->after(function () {
mission_control_notify('Emptied the Failed Jobs table', 'maintenance');
});
})
->onOneServer();

$schedule->command('maintenance:gzip-purge')->monthlyOn(4, '4:45')
->runInBackground()
Expand All @@ -35,14 +36,16 @@ protected function schedule(Schedule $schedule)
->monthlyOn(4, '4:45')
->after(function (Stringable $output) {
mission_control_notify('PHP Outdated Parsing', 'maintenance', $output);
});
})
->onOneServer();

$schedule->command('maintenance:js-outdated')
->monthlyOn(4, '4:45')
->runInBackground()
->after(function (Stringable $output) {
mission_control_notify('JS Outdated Parsing', 'maintenance', $output);
});
})
->onOneServer();
}

/**
Expand Down
8 changes: 8 additions & 0 deletions app/Http/Controllers/Api/ApiDeviceLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

class ApiDeviceLoginController extends Controller
{
/**
* Device Login
*
* Create a new device token for the user.
* Otherwise we fall back to sanctum's default auth methodology.
*
* @return \Illuminate\Http\JsonResponse
*/
public function create(Request $request)
{
$request->validate([
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Models;

use App\Http\Forms\UserForm;
use App\Models\Concerns\DatabaseSearchable;
use App\Models\Concerns\HasActivity;
use App\Models\Concerns\HasAvatar;
Expand All @@ -14,6 +13,7 @@
use App\Models\Concerns\HasTeams;
use App\Models\Concerns\HasTwoFactor;
use App\Notifications\ResetPassword;
use App\View\Forms\UserForm;
use Grafite\Forms\Traits\HasForm;
use Grafite\Support\Models\Concerns\CanAccessFeatures;
use Grafite\Support\Models\Concerns\HasJavascriptData;
Expand Down
11 changes: 11 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
namespace App\Providers;

use App\Models\User;
use Dedoc\Scramble\Scramble;
use Illuminate\Pagination\Paginator;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules\Password;
use Laravel\Cashier\Cashier;

Expand Down Expand Up @@ -40,6 +43,14 @@ public function boot()
{
Paginator::useBootstrap();

Scramble::routes(function (Route $route) {
return Str::startsWith($route->uri, 'api/');
});

// Gate::define('viewApiDocs', function (User $user) {
// return in_array($user->email, ['[email protected]']);
// });

Blade::if('permission', function ($value) {
return request()->user()->hasPermission($value);
});
Expand Down
30 changes: 1 addition & 29 deletions app/View/Forms/UserForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
namespace App\View\Forms;

use App\Models\User;
use Grafite\Forms\Fields\Country;
use Grafite\Forms\Fields\Email;
use Grafite\Forms\Fields\FileWithPreview;
use Grafite\Forms\Fields\Text;
use Grafite\Forms\Fields\Toggled;
use Grafite\Forms\Forms\ModelForm;
use Grafite\Forms\Html\Heading;
use Grafite\Forms\Html\HrTag;

class UserForm extends ModelForm
{
Expand All @@ -37,7 +34,7 @@ class UserForm extends ModelForm

public function fields()
{
return array_merge([
return [
Text::make('name', [
'required' => true,
]),
Expand All @@ -52,31 +49,6 @@ public function fields()
'preview_identifier' => '.avatar',
'preview_as_background_image' => true,
]),
]);
}

public function billingColumns()
{
return [
Heading::make([
'class' => 'mt-4 mb-1',
'content' => 'Billing Details',
'level' => 4,
]),
HrTag::make(),
Email::make('billing_email', [
'label' => 'Email',
'required' => auth()->user()->hasActiveSubscription(),
]),
Text::make('state', [
'label' => 'State',
'required' => auth()->user()->hasActiveSubscription(),
]),
Country::make('country', [
'label' => 'Country',
'required' => auth()->user()->hasActiveSubscription(),
'data-size' => 5,
]),
];
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"bacon/bacon-qr-code": "^2.0",
"barryvdh/laravel-debugbar": "^3.6",
"bepsvpt/secure-headers": "^7.2",
"dedoc/scramble": "^0.9.0",
"grafite/auth": "^1.0",
"grafite/blacksmith": "^1.0",
"grafite/charts": "^2.0",
Expand Down
Loading

0 comments on commit 6a343b4

Please sign in to comment.