jmpagella / people-management
This package allows people management generating the structures and models necessary to carry it out.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jmpagella/people-management
Requires
- php: >=5.6.4
- laravel/framework: 5.5.*|5.6.*|5.7.*|5.8.*|^6.0
This package is auto-updated.
Last update: 2023-06-19 02:27:02 UTC
README
This package allows basic contact management generating the structures and models necessary to carry it out.
Installation
Through the composer:
composer require jmpagella/people-management
Install to publish configuration and migration files:
php artisan people-management:install
Finally run the migrations:
php artisan migrate
Tables
After you run the migration, 8 tables will be created:
- People
- PeopleCategory
- People-PeopleCategory
- PeopleAttributeType
- PeopleTelephone
- PeopleEmail
- PeopleAddress
- PeopleNote
Basic Usage
New Person
$people = new People();
$people->name = 'John';
$people->last_name = 'Doe';
$people->save();
Or you can use:
$people = People::create(['name' => 'John', 'last_name' => 'Doe']);
New Telephone/Email/Address/Note
$people = People::find(1);
PeopleTelephone::create(['people_id' => $people->id, 'telephone' => '444-5555']);
Get Telephones/Emails/Addresses/Notes
$people = People::find(1);
$people->telephones;
Create a category and assign to person
$category = PeopleCategory::create(['name' => 'Client']);
$people = People::find(1);
$people->categories()->attach($category);
$people->categories;
License
This project is licensed under the terms of the MIT license.