From fb3dfca7c91d6c7e5a97fbe01a1bdf3b02ae1452 Mon Sep 17 00:00:00 2001 From: Alexander Krutov Date: Wed, 21 Jun 2023 18:29:32 +0300 Subject: [PATCH 1/4] Adds phpdoc for Attachment model --- src/Attachment/Models/Attachment.php | 25 ++++++++++++++++++++++++ src/Attachment/Models/Attachmentable.php | 5 +++++ 2 files changed, 30 insertions(+) diff --git a/src/Attachment/Models/Attachment.php b/src/Attachment/Models/Attachment.php index cbb57d2b1c..35cf7640db 100644 --- a/src/Attachment/Models/Attachment.php +++ b/src/Attachment/Models/Attachment.php @@ -11,6 +11,8 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Support\Carbon; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; use Orchid\Attachment\MimeTypes; @@ -21,6 +23,29 @@ /** * Class Attachment. + * + * @property int $id; + * @property string $name + * @property string $original_name + * @property string $mime + * @property ?string $extension + * @property int $size + * @property int $sort + * @property int $path + * @property ?string $description + * @property ?string $alt + * @property ?string $hash + * @property string $disk + * @property ?int $user_id + * @property ?string $group + * @property ?Carbon $created_at + * @property ?Carbon $updated_at + * @property ?User $user + * @property null|Attachmentable[]|Collection $relationships + * @property-read ?string $url + * @property-read ?string $relative_url + * @property-read ?string $title + * */ class Attachment extends Model { diff --git a/src/Attachment/Models/Attachmentable.php b/src/Attachment/Models/Attachmentable.php index 662cb89a6b..d76cd755de 100644 --- a/src/Attachment/Models/Attachmentable.php +++ b/src/Attachment/Models/Attachmentable.php @@ -8,6 +8,11 @@ /** * This class represents the relation between attachments and any model that can have them. + * + * @property string $attachmentable_type + * @property int attachmentable_id + * @property int $attachment_id + * */ class Attachmentable extends Model { From b4ed53356124c6d2bbc85ff2b2a35642350d11c6 Mon Sep 17 00:00:00 2001 From: Alexander Krutov Date: Wed, 21 Jun 2023 18:29:40 +0300 Subject: [PATCH 2/4] Adds phpdoc for User model --- src/Platform/Models/User.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Platform/Models/User.php b/src/Platform/Models/User.php index 88378dbee9..b246acf260 100644 --- a/src/Platform/Models/User.php +++ b/src/Platform/Models/User.php @@ -5,9 +5,12 @@ namespace Orchid\Platform\Models; use App\Orchid\Presenters\UserPresenter; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Carbon; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Hash; use Orchid\Access\UserAccess; use Orchid\Access\UserInterface; @@ -19,6 +22,22 @@ use Orchid\Screen\AsSource; use Orchid\Support\Facades\Dashboard; +/** + * + * @property int $id + * @property string $name + * @property string $email + * @property ?Carbon$email_verified_at + * @property string $password + * @property ?string $remember_token + * @property ?Carbon $created_at + * @property ?Carbon $updated_at + * @property ?array $permissions + * @property null|Role[]|Collection $roles + * @method Builder byAccess(string $permitWithoutWildcard) + * @method Builder byAnyAccess(iterable|string $permitWithoutWildcard) + * + */ class User extends Authenticatable implements UserInterface { use Notifiable, UserAccess, AsSource, Filterable, Chartable, HasFactory; From a7c65900807b6a4e2aaede1a9e0671a5eaac954c Mon Sep 17 00:00:00 2001 From: Alexander Krutov Date: Wed, 21 Jun 2023 18:29:47 +0300 Subject: [PATCH 3/4] Adds phpdoc for Role model --- src/Platform/Models/Role.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Platform/Models/Role.php b/src/Platform/Models/Role.php index 3d79df526b..686997ffbb 100644 --- a/src/Platform/Models/Role.php +++ b/src/Platform/Models/Role.php @@ -14,6 +14,13 @@ use Orchid\Metrics\Chartable; use Orchid\Screen\AsSource; +/** + * @property int $id + * @property string $name + * @property string $slug + * @property ?array $permissions + * @property null|User[]|Collection $users + */ class Role extends Model implements RoleInterface { use RoleAccess, Filterable, AsSource, Chartable, HasFactory; From 525dd6d63c4b2204de205be787ec18015e91abf7 Mon Sep 17 00:00:00 2001 From: Alexander Krutov Date: Thu, 22 Jun 2023 00:57:34 +0300 Subject: [PATCH 4/4] fix: model phpdoc --- src/Attachment/Models/Attachmentable.php | 2 +- src/Platform/Models/Role.php | 1 + src/Platform/Models/User.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Attachment/Models/Attachmentable.php b/src/Attachment/Models/Attachmentable.php index d76cd755de..17fc31af1d 100644 --- a/src/Attachment/Models/Attachmentable.php +++ b/src/Attachment/Models/Attachmentable.php @@ -10,7 +10,7 @@ * This class represents the relation between attachments and any model that can have them. * * @property string $attachmentable_type - * @property int attachmentable_id + * @property int $attachmentable_id * @property int $attachment_id * */ diff --git a/src/Platform/Models/Role.php b/src/Platform/Models/Role.php index 686997ffbb..362c1dc47b 100644 --- a/src/Platform/Models/Role.php +++ b/src/Platform/Models/Role.php @@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Collection; use Orchid\Access\RoleAccess; use Orchid\Access\RoleInterface; use Orchid\Filters\Filterable; diff --git a/src/Platform/Models/User.php b/src/Platform/Models/User.php index b246acf260..4aff15dee8 100644 --- a/src/Platform/Models/User.php +++ b/src/Platform/Models/User.php @@ -27,7 +27,7 @@ * @property int $id * @property string $name * @property string $email - * @property ?Carbon$email_verified_at + * @property ?Carbon $email_verified_at * @property string $password * @property ?string $remember_token * @property ?Carbon $created_at