Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jul 16, 2023
1 parent 7acc15e commit 85e8dc3
Show file tree
Hide file tree
Showing 121 changed files with 14,779 additions and 15,168 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/fix-code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: fix-code-style

on:
push:
pull_request:

jobs:
fix-code-style:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Set up Node
uses: actions/setup-node@v2
- name: Install dependencies
run: |
composer install --no-interaction
npm ci
- name: Run Pint
run: composer pint
- name: Run Prettier
run: npm run prettier
- name: Pull changes
run: git pull
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: >
chore: fix code style
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
*.md
**/dist
**/package-lock.json
**/vendor
composer.lock
docs/dist
docs/filament
docs/node_modules
docs/src/pages
docs/torchlight-cache
public/build
public/docs
storage
5 changes: 1 addition & 4 deletions app/Actions/FetchPluginDataFromAnystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Actions;

use Akaunting\Money\Currency;
use Akaunting\Money\Money;
use App\Models\Plugin;
use Illuminate\Support\Facades\Http;
use Throwable;
Expand All @@ -17,8 +15,7 @@ public function __invoke(): void
try {
$advertismentChannels = $anystack
->get('https://api.anystack.sh/v1/affiliate-beta')
->json()
['data'];
->json()['data'];

$advertisementChannel = collect($advertismentChannels)->keyBy('id')['da7855a9-36a1-44a4-87b9-8e5852ae08d2'] ?? null;

Expand Down
1 change: 0 additions & 1 deletion app/Actions/Star.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Actions;

use App\Models\Contracts\Starrable;
use Illuminate\Database\Eloquent\Model;

class Star
{
Expand Down
1 change: 0 additions & 1 deletion app/Actions/Unstar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Actions;

use App\Models\Contracts\Starrable;
use Illuminate\Database\Eloquent\Model;

class Unstar
{
Expand Down
7 changes: 1 addition & 6 deletions app/Console/Commands/FetchRemoteData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

namespace App\Console\Commands;

use App\Actions\FetchLinkThumbnails;
use App\Actions\FetchPluginDataFromGitHub;
use App\Actions\FetchPluginDataFromPackagist;
use App\Actions\FetchPluginDataFromAnystack;
use App\Actions\FetchPluginThumbnails;
use Illuminate\Console\Command;

class FetchRemoteData extends Command
Expand All @@ -17,8 +13,7 @@ class FetchRemoteData extends Command

public function handle(
FetchPluginDataFromAnystack $fetchPluginDataFromAnystack,
): int
{
): int {
$fetchPluginDataFromAnystack();

return 0;
Expand Down
6 changes: 2 additions & 4 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace App\Console;

use App\Console\Commands\FetchRemoteData;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

Expand All @@ -20,12 +19,11 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('fetch-remote-data')->everyFifteenMinutes();
$schedule->command('fetch-remote-data')->everyFifteenMinutes();
}

/**
Expand All @@ -35,7 +33,7 @@ protected function schedule(Schedule $schedule)
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
$this->load(__DIR__ . '/Commands');

require base_path('routes/console.php');
}
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Plugins/FeedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __invoke()
'name' => $plugin->getAuthorName(),
],
'created_at' => $plugin->created_at->toDateTimeString(),
'updated_at' => $plugin->updated_at->toDateTimeString()
'updated_at' => $plugin->updated_at->toDateTimeString(),
])
->all();

Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/Plugins/ListPluginsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use App\Models\Plugin;
use App\Models\PluginCategory;
use App\Models\Star;
use App\Models\Trick;
use App\Models\User;

class ListPluginsController extends Controller
{
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/Plugins/ViewPluginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use App\Http\Controllers\Controller;
use App\Models\Plugin;
use App\Models\User;
use Illuminate\Support\Facades\RateLimiter;

class ViewPluginController extends Controller
{
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Livewire/Plugins/StarPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

use App\Actions\Star;
use App\Actions\Unstar;
use App\Models\Contracts\Starrable;
use App\Models\Plugin;
use Filament\Facades\Filament;
use Livewire\Component;

class StarPlugin extends Component
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class RedirectIfAuthenticated
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null ...$guards
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Requests/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ public function ensureIsNotRateLimited()
*/
public function throttleKey()
{
return Str::lower($this->input('email')).'|'.$this->ip();
return Str::lower($this->input('email')) . '|' . $this->ip();
}
}
2 changes: 0 additions & 2 deletions app/Models/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace App\Models;

use Carbon\CarbonInterface;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Concerns\Orbital;
use Orbit\Drivers\Markdown;

class Author extends Model
{
Expand Down
9 changes: 0 additions & 9 deletions app/Models/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

namespace App\Models;

use App\Enums\PluginLicense;
use App\Enums\PluginStatus;
use App\Models\Contracts\Starrable;
use Carbon\CarbonInterface;
use Flowframe\Previewify\Previewify;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Concerns\Orbital;
use Orbit\Drivers\Markdown;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

class Plugin extends Model implements Starrable
{
Expand Down
1 change: 0 additions & 1 deletion app/Models/PluginCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Concerns\Orbital;
use Orbit\Drivers\Markdown;

class PluginCategory extends Model
{
Expand Down
7 changes: 0 additions & 7 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@

namespace App\Models;

use App\Services\StripeService;
use Filament\Models\Contracts\FilamentUser;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;
use Stripe\Account;
use Stripe\AccountLink;

class User extends Authenticatable implements MustVerifyEmail
{
Expand Down
4 changes: 0 additions & 4 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@
namespace App\Providers;

use App\Models\Article;
use App\Models\Blog\Post;
use App\Models\Link;
use App\Models\Plugin;
use App\Models\Trick;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Stripe\Stripe;
use Stripe\StripeClient;

class AppServiceProvider extends ServiceProvider
{
Expand Down
13 changes: 1 addition & 12 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,14 @@
namespace App\Providers;

use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;

class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
];

/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->registerPolicies();

Expand Down
13 changes: 1 addition & 12 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,16 @@
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];

/**
* Register any events for your application.
*
* @return void
*/
public function boot()
public function boot(): void
{
//
}
Expand Down
31 changes: 2 additions & 29 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,12 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
use Pirsch\Http\Middleware\TrackPageview;

class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
*
* This is used by Laravel authentication to redirect users after login.
*
* @var string
*/
public const HOME = '/';

/**
* The controller namespace for the application.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';

/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->configureRateLimiting();

Expand All @@ -50,12 +28,7 @@ public function boot()
});
}

/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
protected function configureRateLimiting(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
Expand Down
Loading

0 comments on commit 85e8dc3

Please sign in to comment.