Laravel Ban simplify blocking and banning Eloquent models.

Overview

Laravel Ban

cog-laravel-ban

Discord Releases Build Status StyleCI Code Quality License

Introduction

Laravel Ban simplify management of Eloquent model's ban. Make any model bannable in a minutes!

Use case is not limited to User model, any Eloquent model could be banned: Organizations, Teams, Groups and others.

Contents

Features

  • Model can have many bans.
  • Removed bans kept in history as soft deleted records.
  • Most parts of the logic is handled by the BanService.
  • Has middleware to prevent banned user route access.
  • Use case is not limited to User model, any Eloquent model could be banned.
  • Events firing on models ban and unban.
  • Designed to work with Laravel Eloquent models.
  • Has Laravel Nova support.
  • Using contracts to keep high customization capabilities.
  • Using traits to get functionality out of the box.
  • Following PHP Standard Recommendations:
  • Covered with unit tests.

Installation

First, pull in the package through Composer:

$ composer require cybercog/laravel-ban

Registering package

The package will automatically register itself. This step required for Laravel 5.4 or earlier releases only.

Include the service provider within app/config/app.php:

'providers' => [
    Cog\Laravel\Ban\Providers\BanServiceProvider::class,
],

Apply database migrations

At last you need to publish and run database migrations:

$ php artisan vendor:publish --provider="Cog\Laravel\Ban\Providers\BanServiceProvider" --tag="migrations"
$ php artisan migrate

Usage

Prepare bannable model

use Cog\Contracts\Ban\Bannable as BannableContract;
use Cog\Laravel\Ban\Traits\Bannable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements BannableContract
{
    use Bannable;
}

Prepare bannable model database table

Bannable model must have nullable timestamp column named banned_at. This value used as flag and simplify checks if user was banned. If you are trying to make default Laravel User model to be bannable you can use example below.

Create a new migration file

$ php artisan make:migration add_banned_at_column_to_users_table

Then insert the following code into migration file:

<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddBannedAtColumnToUsersTable extends Migration
{
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->timestamp('banned_at')->nullable();
        });
    }
    
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('banned_at');
        });
    }
}

Available methods

Apply ban for the entity

$user->ban();

Apply ban for the entity with reason comment

$user->ban([
    'comment' => 'Enjoy your ban!',
]);

Apply ban for the entity which will be deleted over time

$user->ban([
    'expired_at' => '2086-03-28 00:00:00',
]);

expired_at attribute could be \Carbon\Carbon instance or any string which could be parsed by \Carbon\Carbon::parse($string) method:

$user->ban([
    'expired_at' => '+1 month',
]);

Remove ban from entity

$user->unban();

On unban all related ban models are soft deletes.

Check if entity is banned

$user->isBanned();

Check if entity is not banned

$user->isNotBanned();

Delete expired bans manually

app(\Cog\Contracts\Ban\BanService::class)->deleteExpiredBans();

Determine if ban is permanent

$ban = $user->ban();

$ban->isPermanent(); // true

Or pass null value.

$ban = $user->ban([
   'expired_at' => null,
]);

$ban->isPermanent(); // true

Determine if ban is temporary

$ban = $user->ban([
   'expired_at' => '2086-03-28 00:00:00',
]);

$ban->isTemporary(); // true

Scopes

Get all models which are not banned

$users = User::withoutBanned()->get();

Get banned and not banned models

$users = User::withBanned()->get();

Get only banned models

$users = User::onlyBanned()->get();

Scope auto-apply

To apply query scopes all the time you can define shouldApplyBannedAtScope method in bannable model. If method returns true all banned models will be hidden by default.

use Cog\Contracts\Ban\Bannable as BannableContract;
use Cog\Laravel\Ban\Traits\Bannable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable implements BannableContract
{
    use Bannable;
    
    /**
     * Determine if BannedAtScope should be applied by default.
     *
     * @return bool
     */
    public function shouldApplyBannedAtScope()
    {
        return true;
    }
}

Events

If entity is banned \Cog\Laravel\Ban\Events\ModelWasBanned event is fired.

Is entity is unbanned \Cog\Laravel\Ban\Events\ModelWasUnbanned event is fired.

Middleware

This package has route middleware designed to prevent banned users to go to protected routes.

To use it define new middleware in $routeMiddleware array of app/Http/Kernel.php file:

protected $routeMiddleware = [
    'forbid-banned-user' => \Cog\Laravel\Ban\Http\Middleware\ForbidBannedUser::class,
]

Then use it in any routes and route groups you need to protect:

Route::get('/', [
    'uses' => 'UsersController@profile',
    'middleware' => 'forbid-banned-user',
]);

If you want force logout banned user on protected routes access, use LogsOutBannedUser middleware instead:

protected $routeMiddleware = [
    'logs-out-banned-user' => \Cog\Laravel\Ban\Http\Middleware\LogsOutBannedUser::class,
]

Scheduling

After you have performed the basic installation you can start using the ban:delete-expired command. In most cases you'll want to schedule these command so you don't have to manually run it everytime you need to delete expired bans and unban models.

The command can be scheduled in Laravel's console kernel, just like any other command.

// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command('ban:delete-expired')->everyMinute();
}

Of course, the time used in the code above is just example. Adjust it to suit your own preferences.

Integrations

Changelog

Please see CHANGELOG for more information on what has changed recently.

Upgrading

Please see UPGRADING for detailed upgrade instructions.

Contributing

Please see CONTRIBUTING for details.

Testing

Run the tests with:

$ vendor/bin/phpunit

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev
@badrshs
badr aldeen shek salim
@rickmacgillis
Rick Mac Gillis
@AnsellC
AnsellC
@joearcher
Joe Archer
@Im-Fran
Francisco Solis
@jadamec
Jakub Adamec

Laravel Ban contributors list

Alternatives

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

CyberCog

Comments
  • $user->isBanned() not working

    $user->isBanned() not working

    Hi, I've installed component like instructions but I have some issue. Ban seam working if I sue method Ban() but if I put a future expired date, users are always not banned. Second $user->isBanned() give me always false. Can you help me?

    I've Laravel 5.8 to protect routes I use this code in middleware Route::group(['middleware' => ['auth','logs-out-banned-user']], function () {......

    Thanks

    opened by INattivo 12
  • Events don't fire in phpunit. How do I make them fire?

    Events don't fire in phpunit. How do I make them fire?

    So, I've been struck trying to figure out why the events don't fire for Laravel Ban in PHPUnit, but they function just fine when running the code in the browser.

    Is there something special that I need to do to test for events in packages and make them fire?

    Just an FYI, I ran the Laravel Ban tests and those pass without issue. The code I wrote for my project works just the same as in those tests and in the docs. (Albeit going through application specific code) So, it functions just fine when the browser-based version runs over the LOC that the tests are running.

    I've tested to see if PHPUnit runs the service provider to observe the Ban model in the first place, and it runs that code. I've even manually added the code to observe the model, directly into the test as the first line of code, and that doesn't work. I've also removed all mocking from the tests to allow every event to fire, but the observer doesn't fire, and so the code that checks if a model got banned by the observer setting it in the DB properly, fails the check. It just doesn't fire.

    Something is vehemently trying to make it NOT fire, and I need to know why. I have a hunch that it has to do with the way the code is bootstrapped.

    Here are my tests:

    /**
    	 * @group current
    	 */
    	public function testCanSuspendUser()
    	{
    		$this->expectsEvents(ModelWasBanned::class);
    		
    		$user = factory(User::class)->create();
    		$this->assertFalse($user->isBanned());
    		
    		$user->ban([
    			'comment'		=> 'blah',
    			'expired_at'	=> null,
    		]);
    		
    		$this->assertTrue($user->isBanned());
    	}
    	
    	/**
    	 * @group current
    	 */
    	public function testCanUnsuspendUser()
    	{
    		$this->expectsEvents(ModelWasUnbanned::class);
    		
    		$user = factory(User::class)->create();
    		$user->ban();
    		
    		$user->unban();
    		
    		$this->assertFalse($user->isBanned());
    	}
    
    question 
    opened by rickmacgillis 12
  • Added a cast for the deleted_at field

    Added a cast for the deleted_at field

    When creating a resource for the bans table, the deleted_at column needs to be cast to a datetime object. Without it, filtering deleted bans in the bannable's MorphMany relationship causes an error.

    opened by rickmacgillis 11
  • Support for user UUIDs

    Support for user UUIDs

    I'd like to see this working for user UUIDs out of the box. For now, I help myself with 2 subsequent migrations which alter the columns bannable_id and created_by_id to string(36). This works so far but I am not sure about any side effects. It would be great if there would be a config option for this.

    opened by johlton 8
  • ModelWasBanned doesn't fire - here's why.

    ModelWasBanned doesn't fire - here's why.

    So, today I ran into a problem that caused me to have to solve the issue with some of Laravel Ban's events not firing. I found out that only in the created method of BanObserver, if you try to save the bannable, then it stops the event from firing. Likewise, if that event fires, then it also stops the method from running to completion.

    The only thing I can think of that would do something like that is exit or some kind of exception or error. The problem is that I never use exit in my own code. (I even did a file search on all of my code, and nothing uses that language construct.)

    In my dev environment, I have it set to log all of the errors and exceptions to a single file. It doesn't show any. Plus, Laravel uses filp/Whoops (lol) to display exceptions that crash the system. None of that happened.

    I've spent hours trying to debug this issue, and I'm at an impasse. Any chance you can have a go at it and make the event start firing for everyone?

    opened by rickmacgillis 7
  • Deleted lines which make testing impossible

    Deleted lines which make testing impossible

    Like the flux capacitor and time travel, testing equipment is what makes tests possible!

    To allow for easy contributing, I've altered the .gitattributes file to stop blocking access to testing equipment. I'm planning a second PR with a bug fix, and was originally shocked to see that there weren't any tests, but alas, they were just hidden.

    opened by rickmacgillis 7
  • Not working with Laravel 5.5

    Not working with Laravel 5.5

    Trying to add to Laravel 5.5 results in the following composer error:

    Your requirements could not be resolved to an installable set of packages.

    Problem 1 - The requested package laravel/framework (locked at v5.4.32, required as 5.5.) is satisfiable by laravel/framework[v5.4.32] but these conflict with your requirements or minimum-stability. Problem 2 - The requested package phpunit/phpunit (locked at 5.7.21, required as ~6.0) is satisfiable by phpunit/phpunit[5.7.21] but these conflict with your requirements or minimum-stability. Problem 3 - backpack/base 0.7.21 requires laravel/framework 5.3.|5.4.* -> satisfiable by laravel/framework[5.3.x-dev, 5.4.x-dev, v5.3.0, v5.3.0-RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.29, v5.3.3, v5.3.30, v5.3.31, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. - backpack/base 0.7.21 requires laravel/framework 5.3.|5.4. -> satisfiable by laravel/framework[5.3.x-dev, 5.4.x-dev, v5.3.0, v5.3.0-RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.29, v5.3.3, v5.3.30, v5.3.31, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. - backpack/base 0.7.21 requires laravel/framework 5.3.|5.4. -> satisfiable by laravel/framework[5.3.x-dev, 5.4.x-dev, v5.3.0, v5.3.0-RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.29, v5.3.3, v5.3.30, v5.3.31, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9, v5.4.0, v5.4.1, v5.4.10, v5.4.11, v5.4.12, v5.4.13, v5.4.14, v5.4.15, v5.4.16, v5.4.17, v5.4.18, v5.4.19, v5.4.2, v5.4.20, v5.4.21, v5.4.22, v5.4.23, v5.4.24, v5.4.25, v5.4.26, v5.4.27, v5.4.28, v5.4.29, v5.4.3, v5.4.30, v5.4.31, v5.4.32, v5.4.33, v5.4.34, v5.4.35, v5.4.36, v5.4.4, v5.4.5, v5.4.6, v5.4.7, v5.4.8, v5.4.9] but these conflict with your requirements or minimum-stability. - Installation request for backpack/base (locked at 0.7.21, required as ^0.7.16) -> satisfiable by backpack/base[0.7.21].

    opened by sam-cogan 7
  • Showing expired_at in blade view

    Showing expired_at in blade view

    Hello,

    How do i show the expired_at in my view. I followed this tutorial: http://itsolutionstuff.com/post/how-to-create-ban-revoke-user-functionality-in-laravel-5-example-example.html

    Atm i have this in my view, but the {{$user->expired_at}} doesn't work.. any ideas

    @extends('layouts.app')
    
    @section('content')
    
        <section class="contact-2">
            <div class="container">
                <div class="row contact-details">
                    <div class="m-auto">
                        <h2 id="center_h2">Gebruikers</h2>
                        <div class="divider"></div>
                        @if(Session::has('success'))
                            <div class="alert alert-success">
                                {{ Session::get('success') }}
                                @php
                                    Session::forget('success');
                                @endphp
                            </div>
                        @endif
                        @if (count($users) > 0)
                            <table class="table">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Naam</th>
                                    <th>Email</th>
                                    <th>Voornaam</th>
                                    <th>Achternaam</th>
                                    <th>Geboortedatum</th>
                                    <th>Verbannen tot</th>
                                    <th>Ban?</th>
                                    <th>Rol_id</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($users as $key => $user)
                                    <tr>
                                        <td><a href="{{route('editUser',$user->id)}}">{{$user->id}}</a></td>
                                        <td>{{$user->username}}</td>
                                        <td>{{$user->email}}</td>
                                        <td>{{$user->first_name}}</td>
                                        <td>{{$user->last_name}}</td>
                                        <td>{{$user->date_of_birth}}</td>
                                        <td>
                                            {{--@if($user->isBanned())--}}
                                                {{--verbanen tot--}}
                                                {{--{{$user->expired_at}}--}}
                                            {{--@else--}}
                                                {{--Niet --}}
                                            {{--@endif--}}
                                        </td>
                                        <td>
                                            @if($user->isBanned())
                                                <a href="{{ route('revokeUser',$user->id) }}"
                                                   class="btn btn-success btn-sm"> Revoke</a>
                                            @else
                                                <a class="btn btn-success ban btn-sm" data-id="{{ $user->id }}"
                                                   data-action="{{ URL::route('banUser') }}"> Ban</a>
                                            @endif
                                        </td>
                                        <td>{{$user->role_id}}</td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        @endif
                    </div>
    
                </div>
            </div>
        </section>
    
    @endsection
    

    I hope u can help me.

    Greetings,

    question 
    opened by mouaadBenAllal 6
  • force user to logout if he got banned ,

    force user to logout if he got banned ,

    in the previous implementation , it may case an infinite http loop, middleware will redirect to login page then login page will redirect again to dashboard because the user has login session and so on , auth()->logout(); the issue will happen if shouldApplyBannedAtScope is false as what in my case

    opened by badrshs 5
  • Inertia compatibility

    Inertia compatibility

    I'm using the middleware 'forbid-banned-user', which is working as expected but inertiajs has a little problem with redirects, you must specify the redirect response code 303 which is explained here, it would be useful to have like a setting that enables/disables the inertia fix, like:

    // ...
    'inertia-fix' => false, // default false, you can change it to true.
    // ...
    

    and if it's true you will add 303 as redirect response code. I would do it by myself but I'm a bit busy.

    opened by Im-Fran 4
  • Laravel 8 unsupport and bug

    Laravel 8 unsupport and bug

    Details

    • Laravel version: 8.1.0
    • cyborg version 4.2.x
    • mysql version: Production: Ver 15.1 Distrib 10.3.23-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 Local (dev): Ver 15.1 Distrib 10.4.14-MariaDB, for Linux (x86_64) using EditLine wrapper

    Description

    Hello i have don't heck if your package is ready for laravel 8 so is my fault if is this case.

    My problem is if i run this command: ban:delete-expired every day at 7:00 in UTC timezone i will got these bug:

    • Some of my model of Advertise.php,Category.php,'Topic.php,ProductCategory.php` will be deleted, and if one user or multiples users is banned, in the next schedule your command will ban every users, i have softDelete so i can recover everythings for that is really good 😄

    Step to reproduce:

    • install of cyborg in laravel version 7.25.x : all work like schedule, ban, ...
    • upgrade laravel version 8.1.0 from 7.25.x because laravel telescope have bug in version 7.25.x by following docs
    • install of composer require laravel/legacy-factory support legacy models and factories
    • adding command for check and unban users from your package in app\Console\Kernel.php.
    • wait schedule.
    • some models will be deleted

    Answer

    Did your package support laravel 8 ? Your package can access to relation from any models ? ( that really not good because some model can be delete with onDeleteCascade() )

    opened by jud3v 4
  • Should add Qualified Banned At column name in scopes like SoftDeletes Trait

    Should add Qualified Banned At column name in scopes like SoftDeletes Trait

    Hi,

    I have encountered the issue of ambiguous column banned_at while using the scope functions when child and parent both tables have Bannable Trait. So it will be helpful if this column has a table name alias similar to the SoftDeletes Trait in Laravel.

    opened by shlucky90 0
  • Laravel API Middleware useage

    Laravel API Middleware useage

    I have tried to include the middleware provided by the package. I have been back and forth trying to restrict banned users from logging in. Any solution to this or what am I required to do? I simply wanted users who are currently logged in to be logged out

    opened by kevinwaxi 1
  • allow us to configure the table on different connection / database please

    allow us to configure the table on different connection / database please

    Hello!

    As you know me from my heavy usage of your awesome laravel-love library, I like to split my laravel projects into many databases and I'm doing this for one that uses your laravel-ban package.

    My bans table is on a different database then my main one. Oddly, methods such as isBanned() do not return any error. To be clear, my bans table is on a different database and the isBanned does correctly return true or false.. so it somehow is capable of interacting with the bans table on a different connection. How this is working right now is a bit puzzling!!

    But when I try to actually ->ban() someone I get an error because it's looking for the bans table on the wrong connection.

    Would it be possible for you to add a configuration to allow us to set a different connection please?

    The same way you did it on laravel-love would be perfect:

    
    'storage' => [
            'database' => [
                'connection' => env('DB_CONNECTION', 'mysql'),
    

    Many many thanks!

    opened by vesper8 4
  • Dosen´t refresh the collection when I ban a user

    Dosen´t refresh the collection when I ban a user

    Hi everyone! Excelent work with the package!!!

    I have found in one of my tests that the variable that contained the user model instance was not updated after applying the ban() function to it.

    Example: $user = User::find($id); $user->ban(); if i look into the $user dosen´t have updated the field banned_at.

    I think this should not be the case and should be updated. Hope this helps!

    Thanks!!!

    opened by olkotz 4
  • Middlewares

    Middlewares

    I just wanted to mention that the middlewares need some improvements. And please if you could add some new features such as blocking IP addresses and so on.

    opened by hamzaelmaghari 0
  • Middleware response field customization

    Middleware response field customization

    It would be cool to be able to change login for Laravel's default email here: https://github.com/cybercog/laravel-ban/blob/8b78c2fc86a9a9e050a730149c9466025a673660/src/Http/Middleware/LogsOutBannedUser.php#L57

    And here: https://github.com/cybercog/laravel-ban/blob/8b78c2fc86a9a9e050a730149c9466025a673660/src/Http/Middleware/ForbidBannedUser.php#L51

    This way it would work out-of-the-box with Laravel.

    Currently my workaround is middleware override.

    enhancement 
    opened by antimech 2
Releases(4.7.0)
Owner
cybercog
CyberCog is a Social Unity of enthusiasts. Developing best solutions in the field of product & software development is our passion.
cybercog
Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.

Laravel Befriended Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked

Renoki Co. 720 Jan 3, 2023
A non-blocking stream abstraction for PHP based on Amp.

amphp/byte-stream is a stream abstraction to make working with non-blocking I/O simple. Installation This package can be installed as a Composer depen

Amp 317 Dec 22, 2022
An Eloquent Way To Filter Laravel Models And Their Relationships

Eloquent Filter An Eloquent way to filter Eloquent Models and their relationships Introduction Lets say we want to return a list of users filtered by

Eric Tucker 1.5k Jan 7, 2023
cybercog 996 Dec 28, 2022
An Eloquent Way To Filter Laravel Models And Their Relationships

Eloquent Filter An Eloquent way to filter Eloquent Models and their relationships Introduction Lets say we want to return a list of users filtered by

Eric Tucker 1.5k Dec 30, 2022
🕵️ Inspect Laravel Eloquent models to collect properties, relationships and more.

??️ Eloquent Inspector Inspect Laravel Eloquent models to collect properties, relationships and more. Install Via Composer composer require cerbero/el

Andrea Marco Sartori 111 Nov 4, 2022
Package with small support traits and classes for the Laravel Eloquent models

Contains a set of traits for the eloquent model. In future can contain more set of classes/traits for the eloquent database.

Martin Kluska 3 Feb 10, 2022
A Laravel package to simplify using DPO Payment API in your application.

DPO (Direct Pay Online) Laravel Package The best DPO Laravel package, simple Ever This is the package that will help you add DPO Payment API to your L

Zepson Technologies 5 Nov 17, 2022
Laravel charts is a package to simplify the use of charts.

Laravel Charts Laravel charts is a package to simplify the use of charts. Features Autoregister your charts Customize routing, middleware and prefix t

Datalogix 2 Aug 5, 2022
Use auto generated UUID slugs to identify and retrieve your Eloquent models.

Laravel Eloquent UUID slug Summary About Features Requirements Installation Examples Compatibility table Alternatives Tests About By default, when get

Khalyomede 25 Dec 14, 2022
Record created by, updated by and deleted by on Eloquent models automatically.

quarks/laravel-auditors Record created by, updated by and deleted by (if SoftDeletes added) on Eloquent models automatically. Installation composer re

Quarks 3 Jun 13, 2022
Observe (and react to) attribute changes made on Eloquent models.

Laravel Attribute Observer Requirements PHP: 7.4+ Laravel: 7+ Installation You can install the package via composer: composer require alexstewartja/la

Alex Stewart 55 Jan 4, 2023
Easy creation of slugs for your Eloquent models in Laravel

Eloquent-Sluggable Easy creation of slugs for your Eloquent models in Laravel. NOTE: These instructions are for the latest version of Laravel. If you

Colin Viebrock 3.6k Dec 30, 2022
Automatically validating Eloquent models for Laravel

Validating, a validation trait for Laravel Validating is a trait for Laravel Eloquent models which ensures that models meet their validation criteria

Dwight Watson 955 Dec 25, 2022
Tag support for Laravel Eloquent models - Taggable Trait

Laravel Taggable Trait This package is not meant to handle javascript or html in any way. This package handles database storage and read/writes only.

Rob 859 Dec 11, 2022
Preferences for Laravel Eloquent models

Preferences for Laravel Eloquent models Use this library to bind multiple key/value pair preferences to your application's Eloquent models. Preference

Kevin Laude 32 Oct 30, 2022
Laravel package to search through multiple Eloquent models.

Laravel package to search through multiple Eloquent models. Supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.

Protone Media 845 Jan 1, 2023
Automatic human timestamps for Laravel Eloquent models.

Automatic human timestamp properties in Laravel This package provides a trait you can add to an Eloquent model that will automatically create human-re

Christopher Di Carlo 25 Jul 17, 2022
A new way of Running Tinker. Simplify the Web Artisan's workflow.

Tinkerun A new way of Running Tinker. Simplify the Web Artisan's workflow. inspired by Tinkerwell Download links Github Releases ?? If you are using V

Tinkerun 327 Dec 29, 2022