All Projects → rinvex → Laravel Addresses

rinvex / Laravel Addresses

Licence: mit
Rinvex Addressable is a polymorphic Laravel package, for addressbook management. You can add addresses to any eloquent model with ease.

Labels

Projects that are alternatives of or similar to Laravel Addresses

Laravel Google Captcha
Google captcha for Laravel 5, Laravel 6 and Laravel 7, support multiple captcha on page
Stars: ✭ 168 (-1.18%)
Mutual labels:  laravel
Laravel Movies Example
Code for YouTube series on building a Laravel Movie Application
Stars: ✭ 171 (+0.59%)
Mutual labels:  laravel
Lapse
Laravel Self Hosted Tiny Error Tracking System With Notifications
Stars: ✭ 172 (+1.18%)
Mutual labels:  laravel
Fcm
Firebase Cloud Messaging (FCM) notifications channel for Laravel
Stars: ✭ 169 (-0.59%)
Mutual labels:  laravel
Laravel Nova Nested Form
This package allows you to include your nested relationships' forms into a parent form.
Stars: ✭ 169 (-0.59%)
Mutual labels:  laravel
Laravel Debugbar
Laravel Debugbar (Integrates PHP Debug Bar)
Stars: ✭ 13,485 (+7832.35%)
Mutual labels:  laravel
Partyline
Output to Laravel's console from outside of your Command classes.
Stars: ✭ 168 (-1.18%)
Mutual labels:  laravel
Curryable
An elegant and simple curry(f) implementation in PHP.
Stars: ✭ 172 (+1.18%)
Mutual labels:  laravel
Laravel Selfupdater
This package provides some basic methods to implement a self updating functionality for your Laravel application. Already bundled are some methods to provide a self-update mechanism via Github or some private repository via http.
Stars: ✭ 170 (+0%)
Mutual labels:  laravel
Laradminator
Integration of Adminator into Laravel 6.x/7.x/8.x with RTL support
Stars: ✭ 170 (+0%)
Mutual labels:  laravel
Lara Head
Easily setup SEO in your laravel project with lara-head ❤️ @code4mk
Stars: ✭ 169 (-0.59%)
Mutual labels:  laravel
Laravel Translatable
[Deprecated] A Laravel package for multilingual models
Stars: ✭ 1,974 (+1061.18%)
Mutual labels:  laravel
Koel
🐦 A personal music streaming server that works.
Stars: ✭ 13,105 (+7608.82%)
Mutual labels:  laravel
Breadcrumbs
Laravel Breadcrumbs - An easy way to add breadcrumbs to your @Laravel app.
Stars: ✭ 169 (-0.59%)
Mutual labels:  laravel
Dv Php Core
Devless is a ready-made back-end for development of web or mobile applications. It is fully open source under the permissive Apache v2 license. This means that you can develop your front end without worrying about neither back-end code or the business risk of a proprietary backend-as-a-service.
Stars: ✭ 171 (+0.59%)
Mutual labels:  laravel
Imall
基于Laravel5.2,Vue.js1.0的微信商城,用于熟悉 Laravel、Vuejs、Webpack、Gulp 的结合使用,已不维护及更新。(1MB单核基础服务器,浏览请耐心等待图片加载...)
Stars: ✭ 168 (-1.18%)
Mutual labels:  laravel
Novapackages
Stars: ✭ 169 (-0.59%)
Mutual labels:  laravel
Ddd Laravel Sample
A Laravel DDD sample application using CQRS and persisting entities serialized without ORM
Stars: ✭ 172 (+1.18%)
Mutual labels:  laravel
Laravel Route Attributes
Use PHP 8 attributes to register routes in a Laravel app
Stars: ✭ 171 (+0.59%)
Mutual labels:  laravel
Multi Domain Laravel
An example of multi-domain/subdomain app in Laravel.
Stars: ✭ 171 (+0.59%)
Mutual labels:  laravel

Rinvex Addresses

Rinvex Addresses is a polymorphic Laravel package, for addressbook management. You can add addresses to any eloquent model with ease.

Packagist Scrutinizer Code Quality Travis StyleCI License

Installation

  1. Install the package via composer:

    composer require rinvex/laravel-addresses
    
  2. Publish resources (migrations and config files):

    php artisan rinvex:publish:addresses
    
  3. Execute migrations via the following command:

    php artisan rinvex:migrate:addresses
    
  4. Done!

Usage

To add addresses support to your eloquent models simply use \Rinvex\Addresses\Traits\Addressable trait.

Manage your addresses

// Get instance of your model
$user = new \App\Models\User::find(1);

// Create a new address
$user->addresses()->create([
    'label' => 'Default Address',
    'given_name' => 'Abdelrahman',
    'family_name' => 'Omran',
    'organization' => 'Rinvex',
    'country_code' => 'eg',
    'street' => '56 john doe st.',
    'state' => 'Alexandria',
    'city' => 'Alexandria',
    'postal_code' => '21614',
    'latitude' => '31.2467601',
    'longitude' => '29.9020376',
    'is_primary' => true,
    'is_billing' => true,
    'is_shipping' => true,
]);

// Create multiple new addresses
$user->addresses()->createMany([
    [...],
    [...],
    [...],
]);

// Find an existing address
$address = app('rinvex.addresses.address')->find(1);

// Update an existing address
$address->update([
    'label' => 'Default Work Address',
]);

// Delete address
$address->delete();

// Alternative way of address deletion
$user->addresses()->where('id', 123)->first()->delete();

Manage your addressable model

The API is intuitive and very straight forward, so let's give it a quick look:

// Get instance of your model
$user = new \App\Models\User::find(1);

// Get attached addresses collection
$user->addresses;

// Get attached addresses query builder
$user->addresses();

// Scope Primary Addresses
$primaryAddresses = app('rinvex.addresses.address')->isPrimary()->get();

// Scope Billing Addresses
$billingAddresses = app('rinvex.addresses.address')->isBilling()->get();

// Scope Shipping Addresses
$shippingAddresses = app('rinvex.addresses.address')->isShipping()->get();

// Scope Addresses in the given country
$egyptianAddresses = app('rinvex.addresses.address')->InCountry('eg')->get();

// Find all users within 5 kilometers radius from the latitude/longitude 31.2467601/29.9020376
$fiveKmAddresses = \App\Models\User::findByDistance(5, 'kilometers', '31.2467601', '29.9020376')->get();

// Alternative method to find users within certain radius
$user = new \App\Models\User();
$users = $user->lat('31.2467601')->lng('29.9020376')->within(5, 'kilometers')->get();

Changelog

Refer to the Changelog for a full history of the project.

Support

The following support channels are available at your fingertips:

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md.

Bug reports, feature requests, and pull requests are very welcome.

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity.

License

This software is released under The MIT License (MIT).

(c) 2016-2021 Rinvex LLC, Some rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].