creode / laravel-nova-meet-the-team
Add Meet the Team feature to your Laravel Nova application.
Requires
- php: ^7.3|^8.0
- creode/laravel-repository: ^1.0
- creode/nova-publishable: ^1.1
- laravel/nova: ^4.32
- outl1ne/nova-sortable: ^3.4
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- orchestra/canvas: ^8.11
- orchestra/testbench: ^8.8
README
Module for Laravel Nova to allow a user to add different team members to a website.
Installation
You can install this package via composer using this command:
composer require creode/laravel-nova-meet-the-team
The package will automatically register itself.
Meet the Team Page
This module also has the capability of rendering a page of all teams by visiting "/meet-the-team". To enable this, you can add this service provider to the providers section of your config/app.php file:
'providers' => [ ... Creode\LaravelNovaMeetTheTeam\Providers\MeetTheTeamServiceProvider::class, ... ],
Usage
Publishing Migrations
You can publish the migrations this module exposes with:
php artisan vendor:publish --tag="nova-meet-the-team-migrations"
Publishing Config
You can publish the config this module exposes with:
php artisan vendor:publish --tag="nova-meet-the-team-config"
Configuring Models
You can configure the models this module uses by publishing the config and editing the config file. This allows for the capability to use your own models for the team members and teams.
The suggested way to interact with these models is to use the repository classes that are provided by this module. These can be accessed by using the following classes:
use Creode\LaravelNovaMeetTheTeam\Repositories\TeamRepository; use Creode\LaravelNovaMeetTheTeam\Repositories\TeamMemberRepository;
These repositories as based on the Laravel Repository package.
Ordering by Weight
The team members can be ordered by weight. This is a field that is added to the team members table.
You can order the team members by weight by using the following snippet:
$teams = $teamRepository->with('members')->ordered()->get();