mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Add option for only eloquent (#1636)
* Add option for only eloquent * composer fix-style * Add snapshot * Add option to models command * composer fix-style * Fix namespace --------- Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
co-authored by
laravel-ide-helper
parent
14fdb572bb
commit
347483be03
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Foundation\AliasLoader;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
@@ -89,6 +90,33 @@ class Generator
|
||||
->render();
|
||||
}
|
||||
|
||||
public function generateEloquent()
|
||||
{
|
||||
$name = 'Eloquent';
|
||||
$facade = Model::class;
|
||||
$magicMethods = array_key_exists($name, $this->magic) ? $this->magic[$name] : [];
|
||||
$alias = new Alias($this->config, $name, $facade, $magicMethods, $this->interfaces);
|
||||
if ($alias->isValid()) {
|
||||
//Add extra methods, from other classes (magic static calls)
|
||||
if (array_key_exists($name, $this->extra)) {
|
||||
$alias->addClass($this->extra[$name]);
|
||||
}
|
||||
|
||||
$eloquentAliases['__root'] = [$alias];
|
||||
}
|
||||
|
||||
$app = app();
|
||||
return $this->view->make('helper')
|
||||
->with('namespaces_by_extends_ns', [])
|
||||
->with('namespaces_by_alias_ns', $eloquentAliases)
|
||||
->with('real_time_facades', [])
|
||||
->with('helpers', '')
|
||||
->with('version', $app->version())
|
||||
->with('include_fluent', false)
|
||||
->with('factories', [])
|
||||
->render();
|
||||
}
|
||||
|
||||
protected function detectDrivers()
|
||||
{
|
||||
$defaultUserModel = config('auth.providers.users.model', config('auth.model', 'App\User'));
|
||||
|
||||
Reference in New Issue
Block a user