Pyro
  • Product
    • Features
    • Platform
  • Pro
  • Developers
    • Documentation
    • Guides
    • Videos
    • GitHub
  • Community
    • Blog
    • Forum
    • Discord
    • Twitter
    • Facebook
  • Login

Relationships

  1. Documentation
  2. Application
  3. Streams Platform
  4. Relationships
X
  • Product
  • Features
  • Platform
  • Pyro PRO
  • Developers
  • Documentation
  • Guides
  • Videos
  • GitHub
  • Community
  • Blog
  • Forum
  • Discord
  • Twitter
  • Facebook
  • Login
  • Getting Started
    • Introduction
    • Installation
  • The Basics
    • Streams Plugin
    • Presenters
    • Routing
    • Views
    • Service Container
    • Service Providers
  • Services
    • Asset
    • Authorization
    • Artisan
    • Callbacks
    • Collections
    • Config
    • Currency
    • Evaluator
    • Filesystem
    • Hooks
    • Image
    • Localization
    • Messages
    • Parser
    • Resolver
    • String
    • Valuation
  • UI
    • Breadcrumbs
    • Buttons
    • Control Panel
    • Forms
    • Icons
    • Tables
  • Database
    • Migrations
    • Query Builders
  • Models
    • Relationships
    • Entry Routers
  • Plugin
    • Addon
    • Agent
    • Asset
    • Auth
    • Breadcrumb
    • Favicons
    • Carbon
    • Config
    • CSRF
    • Entries
    • Env
    • Footprint
    • Image
    • Request
    • Route
    • Session
    • String
    • Translator
    • URL
    • View
  • Addons
    • The Basics
    • Field Types
Edit this Page
  • 1.7
  • 1.6
  • 1.5
  • 1.4
  • 1.3

Relationships

Relationships in Pyro work just like relationships in Laravel.

**Note:** Relation type field types will generate the relation model method for you! Naming is camel case of the field slug.

Delete cascade and restrict

You can easily cascade the relation linked to an entity using $cascades in the EntityModel.

Example

$cascades = [
    'relation'
]

You can also restrict the deletion of an entity using $restricts.

Example

$restricts = [
    'relation'
]
  1. Relationships
  2. Delete cascade and restrict

©2025 PyroCMS, Inc.
All rights reserved.