jmpagella / people-management
This package is abandoned and no longer maintained.
No replacement package was suggested.
This package allows people management generating the structures and models necessary to carry it out.
1.2.0
2019-11-18 18:29 UTC
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.