Orchid Platform Documentation

repository·master·Indexed 26 days ago

https://github.com/orchidsoftware/platform

A Laravel-based platform for rapid development of administrative interfaces, dashboards, and back-office applications. It features a code-driven approach to abstract business logic, offering a Form Builder, SPA-like performance via Hotwire, identity-based access control, Eloquent-based filtering, and Laravel Scout integration. Includes a suite of CLI commands for installing the platform and scaffolding screens, layouts, fields, filters, and presenters.

Tokens
1.3K
Snippets
0
Records
15
Agent score
88%

What's inside Orchid

  1. Overview of Laravel Orchid

    master

    Orchid is a free Laravel package designed for rapid application development of back-office applications, admin panels, user panels, and dashboards. It abstracts standard business logic, allowing developers to focus on PHP development rather than HTML, CSS, or JavaScript.

    Key features include:

    • Form Builder: Out-of-the-box support for many form elements.
    • SPA-like Performance: Uses the Hotwire project to enable transitions without page reloads.
    • Access Permissions & Roles: Identity-based access control.
    • Filtering & Sorting: Eloquent-based filtering and sorting for data tables.
    • Full-Text Search: Integrated search powered by Laravel Scout.
    • Notifications: Various notification types to keep users informed.
  2. Create or update an admin user with orchid:admin

    master

    The orchid:admin CLI command allows you to either create a new administrator user or grant full permissions to an existing user by ID.

    Create a new admin

    If you do not provide an --id flag, the command will attempt to create a new user. You can pass the name, email, and password as arguments, or run the command without arguments to be prompted interactively.

    Update an existing user

    To grant an existing user all permissions, provide the --id flag followed by the user's ID. This will force-fill the user's permissions with Orchid::getAllowAllPermission().

    Arguments

    • name (optional): The name of the new user.
    • email (optional): The email of the new user.
    • password (optional): The password for the new user.

    Options

    • --id=: The ID of an existing user to update permissions for.
  3. Create a new field class with orchid:field

    master

    Use the orchid:field command to generate a new Orchid field class and its corresponding Blade view. The command automatically sets the default namespace to Orchid\Fields and generates a Blade view file with a Stimulus controller name derived from the class name.

    Behavior:

    • Namespace: The generated class will be placed in the Orchid\Fields namespace.
    • View Generation: A Blade view is created at a path derived from the field name (e.g., orchid.fields.your_field_name).
    • Stimulus Integration: The command replaces the {{ controller }} placeholder in the view stub with a snake-case version of the class name (e.g., MyCustomField becomes my-custom-field).
    • View Placeholder: The command replaces the {{ view }} placeholder in the class stub with the dot-notation view path.
  4. Install the Orchid platform

    master

    Use the orchid:install command to automate the installation of Orchid files. This command performs the following actions:

    1. Publishes Orchid configuration, migrations, app stubs, and assets.
    2. Runs database migrations.
    3. Creates a symbolic link for storage.
    4. Attempts to update your App\Models\User model to extend Orchid\Platform\Models\User.
    5. Updates namespaces in your application files if App\Models\User exists.

    Manual User Model Update If the command cannot locate app/Models/User.php, you must update it manually:

    • Change extends Authenticatable to extends \Orchid\Platform\Models\User in your User model.
    • Ensure existing properties are not overwritten by the new model structure.