From a24564b20bf4dcb4a6e49ec86bb01eed19d7a003 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 3 Oct 2023 09:47:19 +0200 Subject: [PATCH] Publish laravel stub --- stubs/cast.stub | 31 ++++++++++++++++++++ stubs/console.stub | 19 ++++++++++++ stubs/controller.invokable.stub | 15 ++++++++++ stubs/controller.plain.stub | 13 +++++++++ stubs/event.stub | 35 ++++++++++++++++++++++ stubs/factory.stub | 19 ++++++++++++ stubs/job.queued.stub | 27 +++++++++++++++++ stubs/mail.stub | 41 ++++++++++++++++++++++++++ stubs/markdown-mail.stub | 41 ++++++++++++++++++++++++++ stubs/markdown-notification.stub | 50 ++++++++++++++++++++++++++++++++ stubs/middleware.stub | 17 +++++++++++ stubs/migration.create.stub | 26 +++++++++++++++++ stubs/migration.stub | 20 +++++++++++++ stubs/migration.update.stub | 24 +++++++++++++++ stubs/model.pivot.stub | 12 ++++++++ stubs/model.stub | 17 +++++++++++ stubs/notification.stub | 40 +++++++++++++++++++++++++ stubs/observer.plain.stub | 10 +++++++ stubs/policy.stub | 47 ++++++++++++++++++++++++++++++ stubs/provider.stub | 20 +++++++++++++ stubs/request.stub | 27 +++++++++++++++++ stubs/resource-collection.stub | 21 ++++++++++++++ stubs/resource.stub | 21 ++++++++++++++ stubs/rule.stub | 19 ++++++++++++ stubs/scope.stub | 17 +++++++++++ stubs/seeder.stub | 16 ++++++++++ stubs/view-component.stub | 22 ++++++++++++++ 27 files changed, 667 insertions(+) create mode 100644 stubs/cast.stub create mode 100644 stubs/console.stub create mode 100644 stubs/controller.invokable.stub create mode 100644 stubs/controller.plain.stub create mode 100644 stubs/event.stub create mode 100644 stubs/factory.stub create mode 100644 stubs/job.queued.stub create mode 100644 stubs/mail.stub create mode 100644 stubs/markdown-mail.stub create mode 100644 stubs/markdown-notification.stub create mode 100644 stubs/middleware.stub create mode 100644 stubs/migration.create.stub create mode 100644 stubs/migration.stub create mode 100644 stubs/migration.update.stub create mode 100644 stubs/model.pivot.stub create mode 100644 stubs/model.stub create mode 100644 stubs/notification.stub create mode 100644 stubs/observer.plain.stub create mode 100644 stubs/policy.stub create mode 100644 stubs/provider.stub create mode 100644 stubs/request.stub create mode 100644 stubs/resource-collection.stub create mode 100644 stubs/resource.stub create mode 100644 stubs/rule.stub create mode 100644 stubs/scope.stub create mode 100644 stubs/seeder.stub create mode 100644 stubs/view-component.stub diff --git a/stubs/cast.stub b/stubs/cast.stub new file mode 100644 index 00000000..2a911410 --- /dev/null +++ b/stubs/cast.stub @@ -0,0 +1,31 @@ + $attributes + */ + public function get(Model $model, string $key, mixed $value, array $attributes): mixed + { + return $value; + } + + /** + * Prepare the given value for storage. + * + * @param array $attributes + */ + public function set(Model $model, string $key, mixed $value, array $attributes): mixed + { + return $value; + } +} diff --git a/stubs/console.stub b/stubs/console.stub new file mode 100644 index 00000000..ccc30e55 --- /dev/null +++ b/stubs/console.stub @@ -0,0 +1,19 @@ + + */ + public function broadcastOn(): array + { + return [ + new PrivateChannel('channel-name'), + ]; + } +} diff --git a/stubs/factory.stub b/stubs/factory.stub new file mode 100644 index 00000000..b5d39f58 --- /dev/null +++ b/stubs/factory.stub @@ -0,0 +1,19 @@ + + */ + public function via(object $notifiable): array + { + return ['mail']; + } + + /** + * Get the mail representation of the notification. + */ + public function toMail(object $notifiable): MailMessage + { + return (new MailMessage)->markdown('{{ view }}'); + } + + /** + * Get the array representation of the notification. + * + * @return array + */ + public function toArray(object $notifiable): array + { + return [ + // + ]; + } +} diff --git a/stubs/middleware.stub b/stubs/middleware.stub new file mode 100644 index 00000000..76b7b537 --- /dev/null +++ b/stubs/middleware.stub @@ -0,0 +1,17 @@ +id(); + + // + + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('{{ table }}'); + } +}; diff --git a/stubs/migration.stub b/stubs/migration.stub new file mode 100644 index 00000000..62a5c4a8 --- /dev/null +++ b/stubs/migration.stub @@ -0,0 +1,20 @@ +line('The introduction to the notification.') + ->action('Notification Action', url('/')) + ->line('Thank you for using our application!'); + } + + public function toArray(object $notifiable): array + { + return [ + // + ]; + } +} diff --git a/stubs/observer.plain.stub b/stubs/observer.plain.stub new file mode 100644 index 00000000..61270dde --- /dev/null +++ b/stubs/observer.plain.stub @@ -0,0 +1,10 @@ + + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/stubs/resource-collection.stub b/stubs/resource-collection.stub new file mode 100644 index 00000000..68149ea7 --- /dev/null +++ b/stubs/resource-collection.stub @@ -0,0 +1,21 @@ + + */ + public function toArray(Request $request): array + { + return parent::toArray($request); + } +} diff --git a/stubs/resource.stub b/stubs/resource.stub new file mode 100644 index 00000000..694cb82e --- /dev/null +++ b/stubs/resource.stub @@ -0,0 +1,21 @@ + + */ + public function toArray(Request $request): array + { + return parent::toArray($request); + } +} diff --git a/stubs/rule.stub b/stubs/rule.stub new file mode 100644 index 00000000..10282733 --- /dev/null +++ b/stubs/rule.stub @@ -0,0 +1,19 @@ +