Skip to content
No description or website provided.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src add missing Store import to trai Jun 4, 2019
tests transfer ownership to artisanry Jun 4, 2019
.editorconfig editorconfig Aug 3, 2017
.gitattributes first Nov 25, 2016
.gitignore first Nov 25, 2016
.travis.yml update deps Jan 29, 2018
LICENSE MPL 2.0 Jun 9, 2019
README.md MPL 2.0 Jun 9, 2019
composer.json Laravel 6 Aug 28, 2019
phpunit.xml.dist first Nov 25, 2016
renovate.json Configure Renovate (#14) Oct 6, 2019

README.md

Laravel Settingable

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/settingable

Usage

Within your controllers, before you perform a redirect...

<?php

namespace App;

use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Settingable;
}
// This will be stored in the "default" collection
$user->settings()->all();
$user->settings()->set('key', 'value');
$user->settings()->get('key');
$user->settings()->has('key');
$user->settings()->forget('key');

// This will be stored in the "visuals" collection
$user->settings()->collection('visuals')->all();
$user->settings()->collection('visuals')->set('key', 'value');
$user->settings()->collection('visuals')->get('key');
$user->settings()->collection('visuals')->has('key');
$user->settings()->collection('visuals')->forget('key');

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

Mozilla Public License Version 2.0 (MPL-2.0).

You can’t perform that action at this time.