PHP Method Schema::id, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::id from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples
Frequently Used Methods
Example #1
Show file File: Book.php Project: EchoWine/database
0
 /**
  * Set schema fields
  *
  * @param Schema $schema
  */
 public static function fields($schema)
 {
     $schema->id();
     $schema->string('title')->maxLength(128)->minLength(3)->required();
     $schema->toOne(Author::class, 'author');
     $schema->toOne(Isbn::class, 'isbn', 'isbn_code', 'code');
     $schema->throughMany('orders', Order::class)->resolver(OrderBook::class, 'book', 'order');
     // $schema -> throughMany('orders',Order::class,'id','id');
     // $schema -> throughMany('orders',Order::class) -> inModel(OrderBook::class)
     // $schema -> throughMany('orders',Order::class) -> inTable('orders_books')
     // $this -> orders -> add(Order $order);
     // $this -> orders // Collection orders
     // $this -> orders -> get(0) -> pivot. OrderBoook
     $schema->updated_at();
     $schema->created_at();
 }
Example #2
Show file File: OrderBook.php Project: EchoWine/database
0
 /**
  * Set schema fields
  *
  * @param Schema $schema
  */
 public static function fields($schema)
 {
     $schema->id();
     $schema->toOne(Order::class, 'order')->required();
     $schema->toOne(Book::class, 'book')->required();
 }
Example #3
Show file File: Author.php Project: EchoWine/database
0
 /**
  * Set schema fields
  *
  * @param Schema $schema
  */
 public static function fields($schema)
 {
     $schema->id();
     $schema->string('name')->required();
     $schema->toMany('books', Book::class, 'author');
 }
Example #4
Show file File: Order.php Project: EchoWine/database
0
 /**
  * Set schema fields
  *
  * @param Schema $schema
  */
 public static function fields($schema)
 {
     $schema->id();
     $schema->string('transaction')->required();
     $schema->throughMany('books', Book::class)->resolver(OrderBook::class, 'order', 'book');
 }