Download the PHP package manmohanjit/nova-belongs-to-dependency without Composer
On this page you can find all versions of the php package manmohanjit/nova-belongs-to-dependency. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manmohanjit/nova-belongs-to-dependency
More information about manmohanjit/nova-belongs-to-dependency
Files in manmohanjit/nova-belongs-to-dependency
Package nova-belongs-to-dependency
Short Description Extended Laravel Nova BelongsTo field that can depend on other fields
License MIT
Informations about the package nova-belongs-to-dependency
BelongsTo field with dependency support for Nova
THIS PROJECT IS NO LONGER MAINTAINED, PLEASE USE
https://github.com/webparking/nova-belongs-to-dependency
This package is an extension of Laravel Nova's existing BelongsTo field and Vue components.
Installation
You can install this package on a Laravel app that uses Nova via composer:
Usage
The following will list categories with type_id
equal to the value set in the first BelongsTo field.
Look at the example below for other use cases.
Example
Database Structure
- Type (id, name)
- Posts (id, type_id, category_id, title, body)
- Category (id, type_id, title)
We should only be able to assign categories to posts that belong to the same type.
This is how you would achieve it on the Nova category resource:
This would work if you used a text/enum type
field too.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- nova-belongsto-depend (alternative)
- nova-dependency-container
This tool extends the base Laravel Nova BelongsTo field and is inspired by Nova Dependency Container.
License
The MIT License (MIT). Please see License File for more information.