Skip to content

Commit ca9d152

Browse files
committed
move namespaces
1 parent 5a025f7 commit ca9d152

36 files changed

+67
-65
lines changed

config/mobile-pass.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* by creating your own action class that extend the one that ships with the package.
77
*/
88
'actions' => [
9-
'notify_apple_of_pass_update' => Spatie\LaravelMobilePass\Actions\NotifyAppleOfPassUpdateAction::class,
10-
'register_device' => Spatie\LaravelMobilePass\Actions\RegisterDeviceAction::class,
11-
'unregister_device' => Spatie\LaravelMobilePass\Actions\UnregisterDeviceAction::class,
9+
'notify_apple_of_pass_update' => \Spatie\LaravelMobilePass\Actions\Apple\NotifyAppleOfPassUpdateAction::class,
10+
'register_device' => \Spatie\LaravelMobilePass\Actions\Apple\RegisterDeviceAction::class,
11+
'unregister_device' => \Spatie\LaravelMobilePass\Actions\Apple\UnregisterDeviceAction::class,
1212
],
1313

1414
/*
@@ -25,11 +25,11 @@
2525
* The builders are responsible for creating the pass that will be stored in the `mobile_passes` table.
2626
*/
2727
'builders' => [
28-
'airline' => Spatie\LaravelMobilePass\Builders\AirlinePassBuilder::class,
29-
'boarding' => Spatie\LaravelMobilePass\Builders\BoardingPassBuilder::class,
30-
'coupon' => Spatie\LaravelMobilePass\Builders\CouponPassBuilder::class,
31-
'generic' => Spatie\LaravelMobilePass\Builders\GenericPassBuilder::class,
32-
'store_card' => Spatie\LaravelMobilePass\Builders\StoreCardPassBuilder::class,
28+
'airline' => \Spatie\LaravelMobilePass\Builders\Apple\AirlinePassBuilder::class,
29+
'boarding' => \Spatie\LaravelMobilePass\Builders\Apple\BoardingPassBuilder::class,
30+
'coupon' => \Spatie\LaravelMobilePass\Builders\Apple\CouponPassBuilder::class,
31+
'generic' => \Spatie\LaravelMobilePass\Builders\Apple\GenericPassBuilder::class,
32+
'store_card' => \Spatie\LaravelMobilePass\Builders\Apple\StoreCardPassBuilder::class,
3333
],
3434

3535
'organisation_name' => env('MOBILE_PASS_ORGANISATION_NAME', 'Spatie'),

database/factories/MobilePassFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Spatie\LaravelMobilePass\Database\Factories;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Spatie\LaravelMobilePass\Entities\Image;
6+
use Spatie\LaravelMobilePass\Builders\Apple\Entities\Image;
77
use Spatie\LaravelMobilePass\Models\MobilePass;
88
use Spatie\LaravelMobilePass\Models\MobilePassDevice;
99

docs/advanced-usage/customizing-actions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Let's assume that you want to execute some code before the package sends a notif
1010
```php
1111
namespace App\Actions;
1212

13-
use Spatie\LaravelMobilePass\Actions\NotifyAppleOfPassUpdateAction;
14-
use Spatie\LaravelMobilePass\Models\MobilePass;
13+
use Spatie\LaravelMobilePass\Actions\Apple\NotifyAppleOfPassUpdateAction;use Spatie\LaravelMobilePass\Models\MobilePass;
1514

1615
class CustomNotifyAppleOfPassUpdateAction extends NotifyAppleOfPassUpdateAction
1716
{

docs/basic-usage/generating-your-first-pass.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The package offers [various builder classes](TODO: add link) that you can use to
88
Here's an example of how you can generate a basic boarding pass:
99

1010
```php
11-
use Spatie\LaravelMobilePass\Builders\AirlinePassBuilder;
11+
use Spatie\LaravelMobilePass\Builders\Apple\AirlinePassBuilder;
1212

1313
$mobilePass = AirlinePassBuilder::make()
1414
->setOrganisationName('My organisation')

src/Actions/CreateGooglePassClass.php renamed to src/Actions/Apple/CreateGooglePassClass.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Actions;
3+
namespace Spatie\LaravelMobilePass\Actions\Apple;
44

5+
use Exception;
56
use Google\Client;
67
use GuzzleHttp\ClientInterface;
78
use Illuminate\Support\Str;
@@ -39,6 +40,8 @@ public function execute(MobilePass $mobilePass)
3940
// TODO: what should the classId be?
4041
// It needs to be unique to the type of pass we're generating,
4142
// like a template. But _not_ unique to each pass we generate.
43+
44+
// Freek: maybe an md5 of (certain pieces of the content?)
4245
$classId = (string) Str::uuid();
4346

4447
$payload = [
@@ -57,7 +60,7 @@ public function execute(MobilePass $mobilePass)
5760
$response = json_decode($response->getBody());
5861

5962
if (! empty($response->error)) {
60-
throw new \Exception($response->error->message);
63+
throw new Exception($response->error->message);
6164
}
6265

6366
return $classId;

src/Actions/NotifyAppleOfPassUpdateAction.php renamed to src/Actions/Apple/NotifyAppleOfPassUpdateAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Actions;
3+
namespace Spatie\LaravelMobilePass\Actions\Apple;
44

55
use Illuminate\Support\Facades\Http;
66
use Spatie\LaravelMobilePass\Models\MobilePass;

src/Actions/RegisterDeviceAction.php renamed to src/Actions/Apple/RegisterDeviceAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Actions;
3+
namespace Spatie\LaravelMobilePass\Actions\Apple;
44

55
use Spatie\LaravelMobilePass\Models\MobilePass;
66
use Spatie\LaravelMobilePass\Models\MobilePassDevice;

src/Actions/UnregisterDeviceAction.php renamed to src/Actions/Apple/UnregisterDeviceAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Actions;
3+
namespace Spatie\LaravelMobilePass\Actions\Apple;
44

55
use Spatie\LaravelMobilePass\Models\MobilePassRegistration;
66
use Spatie\LaravelMobilePass\Support\Config;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Builders;
3+
namespace Spatie\LaravelMobilePass\Builders\Apple;
44

55
use Spatie\LaravelMobilePass\Enums\TransitType;
66

src/Builders/BoardingPassBuilder.php renamed to src/Builders/Apple/BoardingPassBuilder.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace Spatie\LaravelMobilePass\Builders;
3+
namespace Spatie\LaravelMobilePass\Builders\Apple;
44

55
use Illuminate\Support\Carbon;
66
use Illuminate\Support\Collection;
7-
use Spatie\LaravelMobilePass\Entities\Image;
8-
use Spatie\LaravelMobilePass\Entities\Location;
9-
use Spatie\LaravelMobilePass\Entities\PersonName;
10-
use Spatie\LaravelMobilePass\Entities\Seat;
7+
use Spatie\LaravelMobilePass\Builders\Apple\Entities\Image;
8+
use Spatie\LaravelMobilePass\Builders\Apple\Entities\Location;
9+
use Spatie\LaravelMobilePass\Builders\Apple\Entities\PersonName;
10+
use Spatie\LaravelMobilePass\Builders\Apple\Entities\Seat;
1111
use Spatie\LaravelMobilePass\Enums\PassType;
1212
use Spatie\LaravelMobilePass\Enums\TransitType;
1313
use Spatie\LaravelMobilePass\Validators\BoardingPassValidator;

0 commit comments

Comments
 (0)