feat: meal post visibility
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use App\Enums\MealPostVisibility;
|
||||
use App\Models\MealPosts;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
@@ -16,13 +17,14 @@ class MealPostsResource extends JsonResource
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'imageUrl' => $this->image_url,
|
||||
'imageUrl' => $this->image_url ? asset(Storage::url($this->image_url)) : null,
|
||||
'caption' => $this->caption,
|
||||
'calories' => $this->calories,
|
||||
'proteins' => $this->proteins,
|
||||
'carbs' => $this->carbs,
|
||||
'fats' => $this->fats,
|
||||
'title' => $this->title,
|
||||
'visibility' => $this->visibility,
|
||||
'eatenAt' => $this->eaten_at,
|
||||
'createdAt' => $this->created_at,
|
||||
'updatedAt' => $this->updated_at,
|
||||
|
||||
Reference in New Issue
Block a user