Otherwise phpstorm doesn't understand the paths correctly. He thinks that this is not a complete application, but a package. And when creating a class, the namespace indicates “app” with a small letter, but should be “App”.
24 lines
448 B
PHP
24 lines
448 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\Storage;
|
|
|
|
use App\Models\Storage;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class Upload extends JsonResource
|
|
{
|
|
/**
|
|
* @var Storage
|
|
*/
|
|
public $resource;
|
|
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->resource->id,
|
|
'url' => $this->resource->url,
|
|
];
|
|
}
|
|
}
|