first commit

This commit is contained in:
Doar Mihai
2026-08-08 18:03:29 +03:00
commit df2128ebff
183 changed files with 18719 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class CategoryResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'parent_id' => $this->parent_id,
'name' => $this->name,
'slug' => $this->slug,
'description' => $this->description,
'meta_title' => $this->meta_title,
'meta_description' => $this->meta_description,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PostResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'title' => $this->title,
'slug' => $this->slug,
'excerpt' => $this->excerpt,
'body' => $this->body,
'featured_image' => $this->featured_image,
'status' => $this->status,
'published_at' => $this->published_at,
'meta_title' => $this->meta_title,
'meta_description' => $this->meta_description,
'author' => new UserResource($this->whenLoaded('user')),
'category' => new CategoryResource($this->whenLoaded('category')),
'tags' => TagResource::collection($this->whenLoaded('tags')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class TagResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ToolResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'slug' => $this->slug,
'description' => $this->description,
'url' => $this->url,
'logo_url' => $this->logo_url,
'category' => $this->category,
'category_label' => $this->category_label,
'subcategory' => $this->subcategory,
'tags' => $this->tags,
'pricing' => $this->pricing,
'features' => $this->features,
'views' => $this->views,
'clicks' => $this->clicks,
'featured' => $this->featured,
'approved' => $this->approved,
'submitted_by' => new UserResource($this->whenLoaded('user')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class UserResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'email' => $this->email,
];
}
}