virtualcomplete / user-extension by virtualcomplete

Package to extend and standardize additional user attributes for cross-compatibility of Laravel packages
10
1
3
Package Data
Maintainer Username: virtualcomplete
Maintainer Contact: devon.b@virtualcomplete.com (Devon Bessemer)
Package Create Date: 2016-11-02
Package Last Update: 2017-02-05
Language: PHP
License: MIT
Last Refreshed: 2024-12-17 03:01:02
Package Statistics
Total Downloads: 10
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Laravel User Extension

Package to extend and standardize additional user attributes in Laravel

Why is this needed?

The standard users table only contains a select few fields. This is by design, of course, allowing people to use Laravel for many purposes, but this project is designed for any of the following use cases:

  1. Business projects that need additional user information and the ability to store multiple addresses or phone numbers for a single user.
  2. Cross compatibility with Laravel packages. The idea is to standardize the additional user attributes so Laravel packages can more easily work together using the same method of accessing these attributes.

UserExtension

Functionality: Adds additional fields to the users table and properties to the User model.

Adds the fields to the users table:

  • company_name
  • country (2 char)
  • language (2 char)
  • time_zone (meant to be linux format: America/New_York)
  • deleted_at (soft deletes)

Adds a user_addresses table with relationship to User:

  • type (ex. Physical, Billing, Mailing)
  • line_1
  • line_2
  • city
  • state
  • zip
  • country
  • default (0/1)

Adds a user_phones table with relationship to User:

  • type (ex. Mobile, Work, Home)
  • number (+\d only, ex: +1 (555) 555-5555 becomes +15555555555, makes it easily searchable)
  • extension
  • default (0/1)

Installation Steps:

  1. Run user_extension migration
  2. Add implements UserExtensionInterface to your User Model
  3. Add use UserExtensionTrait to your User Model