fk/laravel-references

Just docs and auto-completion for Laravel development

Downloads

113

Stars

1

Version

v2.0.10

laravel-references

Class references for the Laravel default facades and methods that invoke __call of a class

This is convenient for IDE code completion Inspired by barryvdh

Directory

  • config
    • framework.php

      Contains all caller => callee classes

    • framework.__call.php

      Contains all refers in __call, this will be called recursively

Register

<?php

namespace App\Providers;

use fk\reference\IdeReferenceServiceProvider;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->register(IdeReferenceServiceProvider::class);
    }
}

Publish

artisan vendor:publish

Usage

Generate a eloquent model with properties with database constrains (as rules).

artisan reference:model table_name

Event: Eloquent saving

Register event-listener in your event provider, and then every saving will validate the rules in Eloquent first.

How

Update \App\Providers\EventServiceProvider set $listen

protected $listen = [
    \App\Events\ModelSaving::class => [
        \App\Listeners\CheckRules::class,
    ],
];
Yelfive

Author

Yelfive