<commit_before>Laravel Addresses Plugin
============

Link a list of addresses to a user. Allows to flag address as primary, billing, or shipping. Users have many addresses, but only one primary or shipping or billing.

Currently this thing is linked to Sentry. I'm trying to remove that dependancy (but not sure how yet)

#### Composer Install

    "require": {
        "rtconner/laravel-addresses": "dev-master"
    }

#### Run the migrations

	php artisan migrate --package=rtconner/laravel-addresses
	
#### Install the Service Provider 

	'providers' => array(
		'Conner\Addresses\AddressesServiceProvider',
	),
	
#### Setup your User (this is not required, just a perk)

    class User extends \Eloquent {
		use \Conner\Addresses\Addressable;
    }

#### Sample Usage

    \Addresses::getAll($user->id); // get all users
    
    if(Addresses::getValidator()->fails()) { } // validate before saving
    
    $address = Addresses::createAddress(\Input::all()); // this does not auto-validate
    
    $address = Addresses::updateAddress(\Input::all()); // this does not auto-validate
    
    Addresses::deleteAddress($address);
    
    Addresses::setPrimary($address); // set address as primary (and unset the others)
    
	Addresses::getPrimary($user);    
    
	Addresses::getShipping($user);    

	Addresses::getBilling($user);    

#### View Templates

	@include('addresses::fields') <!-- bootstrap fields with no form tags -->
	
	@foreach($addresses as $address)
		@include('addresses::view', compact('separator'=>'<br>')) <!-- read-only html of address -->
	@endforeach 
	
You can make call direcly on the Conners\Addresses\Address model if you want. But you just have to be careful when reading/writing. The methods provided on \Addresses handle checks against the currently logged in user and making sure there are no duplicate primary addresses.<commit_msg>small syntax fix to readme<commit_after>Laravel Addresses Plugin
============

Link a list of addresses to a user. Allows to flag address as primary, billing, or shipping. Users have many addresses, but only one primary or shipping or billing.

Currently this thing is linked to Sentry. I'm trying to remove that dependancy (but not sure how yet)

#### Composer Install

    "require": {
        "rtconner/laravel-addresses": "dev-master"
    }

#### Run the migrations

	php artisan migrate --package=rtconner/laravel-addresses
	
#### Install the Service Provider 

	'providers' => array(
		'Conner\Addresses\AddressesServiceProvider',
	),
	
#### Setup your User (this is not required, just a perk)

    class User extends \Eloquent {
		use \Conner\Addresses\Addressable;
    }

#### Sample Usage

    \Addresses::getAll($user->id); // get all users
    
    if(Addresses::getValidator()->fails()) { } // validate before saving
    
    $address = Addresses::createAddress(\Input::all()); // this does not auto-validate
    
    $address = Addresses::updateAddress(\Input::all()); // this does not auto-validate
    
    Addresses::deleteAddress($address);
    
    Addresses::setPrimary($address); // set address as primary (and unset the others)
    
	Addresses::getPrimary();    
    
	Addresses::getShipping($userId);    

	Addresses::getBilling();    

#### View Templates

	@include('addresses::fields') <!-- bootstrap fields with no form tags -->
	
	@foreach($addresses as $address)
		@include('addresses::view', compact('separator'=>'<br>')) <!-- read-only html of address -->
	@endforeach 
	
You can make call direcly on the Conners\Addresses\Address model if you want. But you just have to be careful when reading/writing. The methods provided on \Addresses handle checks against the currently logged in user and making sure there are no duplicate primary addresses.
{'fraction_non_alphanumeric': 0.12269938650306748, 'fraction_numerical': 0.0, 'mean_word_length': 3.7770700636942673, 'pattern_counts': {'":': 4, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2385081', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1015, 'n_words': 367}