mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 02:36:52 +01:00 
			
		
		
		
	 da195fd2fe
			
		
	
	
		da195fd2fe
		
			
		
	
	
	
	
		
			
			* Not found property rule * Make these “better” * Day 1 * Day 2 * Day 3 * Dat 4 * Remove disabled check * Day 4 continued * Run pint * Final changes hopefully * Pint fixes * Fix again * Reset these * Update app/Filament/Admin/Pages/Health.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> * Update app/Traits/CheckMigrationsTrait.php Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com> --------- Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Transformers\Api\Client;
 | |
| 
 | |
| use Carbon\Carbon;
 | |
| use Illuminate\Support\Arr;
 | |
| 
 | |
| class FileObjectTransformer extends BaseClientTransformer
 | |
| {
 | |
|     /**
 | |
|      * @param array{
 | |
|      *     name: string,
 | |
|      *     mode: string,
 | |
|      *     mode_bits: mixed,
 | |
|      *     size: int,
 | |
|      *     file: bool,
 | |
|      *     symlink: bool,
 | |
|      *     mime: string,
 | |
|      *     created: mixed,
 | |
|      *     modified: mixed,
 | |
|      * } $item
 | |
|      */
 | |
|     public function transform($item): array
 | |
|     {
 | |
|         return [
 | |
|             'name' => Arr::get($item, 'name'),
 | |
|             'mode' => Arr::get($item, 'mode'),
 | |
|             'mode_bits' => Arr::get($item, 'mode_bits'),
 | |
|             'size' => Arr::get($item, 'size'),
 | |
|             'is_file' => Arr::get($item, 'file', true),
 | |
|             'is_symlink' => Arr::get($item, 'symlink', false),
 | |
|             'mimetype' => Arr::get($item, 'mime', 'application/octet-stream'),
 | |
|             'created_at' => Carbon::parse(Arr::get($item, 'created', ''))->toAtomString(),
 | |
|             'modified_at' => Carbon::parse(Arr::get($item, 'modified', ''))->toAtomString(),
 | |
|         ];
 | |
|     }
 | |
| 
 | |
|     public function getResourceName(): string
 | |
|     {
 | |
|         return 'file_object';
 | |
|     }
 | |
| }
 |