Parse and validate AT Protocol Lexicons with DTO generation for Laravel
at main 50 lines 900 B view raw
1<?php 2 3namespace SocialDept\AtpSchema\Generated\App\Bsky\Embed\Images; 4 5use SocialDept\AtpSchema\Data\Data; 6 7/** 8 * GENERATED CODE - DO NOT EDIT 9 * 10 * Lexicon: app.bsky.embed.images.view 11 * Type: object 12 * 13 * @property array $images 14 * 15 * Constraints: 16 * - Required: images 17 * - images: Max length: 4 18 */ 19class View extends Data 20{ 21 public function __construct( 22 public readonly array $images 23 ) { 24 } 25 26 /** 27 * Get the lexicon NSID for this data type. 28 * 29 * @return string 30 */ 31 public static function getLexicon(): string 32 { 33 return 'app.bsky.embed.images.view'; 34 } 35 36 37 /** 38 * Create an instance from an array. 39 * 40 * @param array $data The data array 41 * @return static 42 */ 43 public static function fromArray(array $data): static 44 { 45 return new static( 46 images: $data['images'] ?? [] 47 ); 48 } 49 50}