Skip to content

Commit

Permalink
Patch models (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
mckenziearts committed Aug 22, 2023
1 parent caa5935 commit a64f130
Show file tree
Hide file tree
Showing 57 changed files with 283 additions and 829 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"require": {
"php": "^8.1",
"spatie/laravel-medialibrary": "^10.4.1",
"spatie/laravel-permission": "^5.5.2"
"spatie/laravel-permission": "^5.5.2",
"staudenmeir/laravel-adjacency-list": "^1.0"
},
"autoload": {
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down Expand Up @@ -88,7 +88,7 @@ public function up(): void
});

app('cache')
->store('default' != config('permission.cache.store') ? config('permission.cache.store') : null)
->store('default' !== config('permission.cache.store') ? config('permission.cache.store') : null)
->forget(config('permission.cache.key'));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Schema;
use Shopper\Core\Helpers\Migration;

return new class extends Migration
return new class() extends Migration
{
public function up(): void
{
Expand Down
3 changes: 2 additions & 1 deletion src/Console/Thanks.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Shopper\Core\Console;

use const PHP_OS_FAMILY;

use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -19,7 +20,7 @@ final class Thanks
' - Tweet something about Shopper on Twitter:',
' <options=bold>https://twitter.com/laravelshopper</>',
' - Sponsor the creator:',
' <options=bold>https://opencollective.com/shopperlabs</>',
' <options=bold>https://github.com/sponsors/mckenziearts</>',
];

public function __construct(private readonly OutputInterface $output)
Expand Down
10 changes: 5 additions & 5 deletions src/Enum/OrderStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ enum OrderStatus: string
public function badge(): string
{
return match ($this) {
self::PENDING => 'border-yellow-200 bg-yellow-100 text-yellow-800',
self::REGISTER => 'border-blue-200 bg-blue-100 text-blue-800',
self::PAID => 'border-green-200 bg-green-100 text-green-800',
self::CANCELLED => 'border-pink-200 bg-pink-100 text-pink-800',
self::COMPLETED => 'border-purple-200 bg-purple-100 text-purple-800',
self::PENDING => 'bg-yellow-100 text-yellow-800',
self::REGISTER => 'bg-primary-100 text-primary-800',
self::PAID => 'bg-green-100 text-green-800',
self::CANCELLED => 'bg-pink-100 text-pink-800',
self::COMPLETED => 'bg-purple-100 text-purple-800',
};
}

Expand Down
17 changes: 17 additions & 0 deletions src/Events/Orders/AddNote.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Shopper\Core\Events\Orders;

use Illuminate\Queue\SerializesModels;
use Shopper\Core\Models\Order;

final class AddNote
{
use SerializesModels;

public function __construct(public Order $order)
{
}
}
17 changes: 17 additions & 0 deletions src/Events/Orders/Cancel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Shopper\Core\Events\Orders;

use Illuminate\Queue\SerializesModels;
use Shopper\Core\Models\Order;

final class Cancel
{
use SerializesModels;

public function __construct(public Order $order)
{
}
}
17 changes: 17 additions & 0 deletions src/Events/Orders/Completed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Shopper\Core\Events\Orders;

use Illuminate\Queue\SerializesModels;
use Shopper\Core\Models\Order;

final class Completed
{
use SerializesModels;

public function __construct(public Order $order)
{
}
}
17 changes: 17 additions & 0 deletions src/Events/Orders/Create.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Shopper\Core\Events\Orders;

use Illuminate\Queue\SerializesModels;
use Shopper\Core\Models\Order;

final class Create
{
use SerializesModels;

public function __construct(public Order $order)
{
}
}
17 changes: 17 additions & 0 deletions src/Events/Orders/Delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

namespace Shopper\Core\Events\Orders;

use Illuminate\Queue\SerializesModels;
use Shopper\Core\Models\Order;

final class Delete
{
use SerializesModels;

public function __construct(public Order $order)
{
}
}
Loading

0 comments on commit a64f130

Please sign in to comment.