Skip to content

Feature/add image for category #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Http/Resources/Category/CategoryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace CSlant\Blog\Api\Http\Resources\Category;

use CSlant\Blog\Core\Facades\Base\Media\RvMedia;
use CSlant\Blog\Core\Models\Category;
use CSlant\Blog\Core\Models\Slug;
use Illuminate\Http\Request;
Expand All @@ -27,6 +28,8 @@
// 'url' => $this->url,
'icon' => $this->icon,
'description' => $this->description,
'image' => $this->image ? RvMedia::url($this->image) : null,

Check failure on line 31 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 31 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 31 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.3

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 31 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 31 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.
'color' => $this->color,

Check failure on line 32 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 32 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 32 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.3

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 32 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 32 in src/Http/Resources/Category/CategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.
];
}
}
3 changes: 3 additions & 0 deletions src/Http/Resources/Category/ListCategoryResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace CSlant\Blog\Api\Http\Resources\Category;

use CSlant\Blog\Core\Facades\Base\BaseHelper;
use CSlant\Blog\Core\Facades\Base\Media\RvMedia;
use CSlant\Blog\Core\Models\Category;
use CSlant\Blog\Core\Models\Slug;
use Illuminate\Http\Request;
Expand Down Expand Up @@ -32,6 +33,8 @@
'children' => CategoryResource::collection($this->children),
'parent' => new CategoryResource($this->parent),
'posts_count' => $this->posts_count,
'image' => $this->image ? RvMedia::url($this->image) : null,

Check failure on line 36 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 36 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 36 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.3

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 36 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.

Check failure on line 36 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$image.
'color' => $this->color,

Check failure on line 37 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 37 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 37 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.3

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 37 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.4

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.

Check failure on line 37 in src/Http/Resources/Category/ListCategoryResource.php

View workflow job for this annotation

GitHub Actions / PHPStan - P8.2

Access to an undefined property CSlant\Blog\Core\Models\Category::$color.
];
}
}
Loading