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