├── .github └── FUNDING.yml ├── .gitignore ├── CHANGELOG.md ├── README.md ├── composer.json ├── config └── repository.php └── src ├── Console ├── Commands │ ├── InstallPackageCommand.php │ ├── MakeRepositoryCommand.php │ └── MakeRepositoryProviderCommand.php └── Stubs │ ├── RepositoryInterface.stub │ ├── RepositoryServiceProvider.stub │ └── repository.stub ├── Facades └── RepositoryFacade.php ├── Providers └── RepositoryServiceProvider.php ├── Repositories ├── BaseRepository.php └── IBaseEloquentRepositoryInterface.php ├── Repository.php └── Traits ├── GetStubs.php ├── HelpersMethods.php └── Validation.php /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://idpay.ir/laravelir'] 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | node_modules/ 3 | npm-debug.log 4 | yarn-error.log 5 | composer.lock 6 | *.meta.* 7 | _ide_* 8 | .phpunit.result.cache 9 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to `miladimos/laravel-repository` will be documented in this file. 4 | 5 | 6 | 7 | ## [0.5.0] - 2020-08-31 8 | 9 | ### Added Basic Functionality 10 | - support for Laravel 7 11 | 12 | 13 | [0.5.0]: https://github.com/miladimos/laravel-repository/compare/v0.5.0...v0.5.0 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | - [![Starts](https://img.shields.io/github/stars/miladimos/laravel-repository?style=flat&logo=github)](https://github.com/miladimos/laravel-repository/forks) 2 | - [![Forks](https://img.shields.io/github/forks/miladimos/laravel-repository?style=flat&logo=github)](https://github.com/miladimos/laravel-repository/stargazers) 3 | 4 | ### in your project 5 | 6 | `composer require miladimos/laravel-repository` 7 | 8 | ### for install package 9 | 10 | `php artisan repository:install` 11 | 12 | ### for create new repository 13 | 14 | `php artisan make:repository {ModelName}` 15 | 16 | ### Example: 17 | 18 | `php artisan make:repository Tag` 19 | 20 | this create a TagRepository and TagEloquentRepositoryInterface 21 | 22 | next you must add Repository to RepositoryServiceProvider in repositories property like: 23 | 24 | ```php 25 | protected $repositories = [ 26 | [ 27 | TagEloquentRepositoryInterface::class, 28 | TagRepository::class, 29 | ], 30 | ]; 31 | ``` 32 | 33 | next in your controller add this: 34 | 35 | ```php 36 | private $tagRepo; 37 | public function __construct(TagEloquentRepositoryInterface $tagRepo) 38 | { 39 | $this->tagRepo = $tagRepo; 40 | } 41 | 42 | ``` 43 | 44 | add custom methods in TagEloquentRepositoryInterface and implement them. 45 | 46 | you must have a provider with below content and register it: 47 | 48 | ```php 49 | repositories as $repository) { 71 | $this->app->bind($repository[0], $repository[1]); 72 | } 73 | } 74 | } 75 | ``` 76 | 77 | or create it automatically by below command: 78 | 79 | ```php 80 | php artisan make:repository:provider 81 | ``` 82 | 83 | and add to app.php providers: 84 | 85 | ```php 86 | App\Providers\RepositoryServiceProvider::class, 87 | ``` 88 | 89 | #### Methods: 90 | 91 | ```php 92 | $model->all($columns = ['*']); 93 | 94 | $model->create(array $data); 95 | 96 | $model->update(array $data, $id, $attribute = "id"); 97 | 98 | $model->find($id); 99 | 100 | $model->findOrFail($id); 101 | 102 | $model->findWhere(string $field, $condition, $columns); 103 | 104 | $model->first(); 105 | 106 | $model->last(); 107 | 108 | $model->firstOrCreate(); 109 | 110 | $model->whereIn($attribute, array $values); 111 | 112 | $model->max($column); 113 | 114 | $model->min($column); 115 | 116 | $model->avg($column); 117 | 118 | $model->delete($id); 119 | 120 | $model->truncate(); 121 | 122 | $model->count($columns = ['*']); 123 | 124 | $model->paginate($columns = ['*'], $perPage = 8); 125 | 126 | $model->simplePaginate($limit = null, $columns = ['*']); 127 | 128 | $model->search(array $query, $columns = ["*"]); 129 | 130 | $model->pluck($value, $key = null); 131 | 132 | $model->with($relations); 133 | 134 | $model->toSql(); 135 | 136 | 137 | ``` 138 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "miladimos/laravel-repository", 3 | "description": "a powerful and simple to use package for repository pattern", 4 | "homepage": "https://github.com/miladimos/laravel-repository", 5 | "type": "library", 6 | "version": "0.8.8", 7 | "keywords": [ 8 | "laravel", 9 | "laravel-package", 10 | "laravel-repository", 11 | "laravel support", 12 | "lumen packages", 13 | "laravel packages", 14 | "lumen support", 15 | "repository pattern", 16 | "design pattern", 17 | "repository" 18 | ], 19 | "authors": [ 20 | { 21 | "name": "miladimos", 22 | "email": "miladimos@outlook.com", 23 | "role": "maintaner", 24 | "homepage": "https://github.com/miladimos" 25 | } 26 | ], 27 | "autoload": { 28 | "psr-4": { 29 | "Miladimos\\Repository\\": "src/" 30 | } 31 | }, 32 | "autoload-dev": { 33 | "psr-4": { 34 | "Miladimos\\Repository\\Tests\\": "tests" 35 | } 36 | }, 37 | "extra": { 38 | "laravel": { 39 | "providers": [ 40 | "Miladimos\\Repository\\Providers\\RepositoryServiceProvider" 41 | ], 42 | "aliases": { 43 | "Repository": "Miladimos\\Repository\\Facades\\RepositoryFacade" 44 | } 45 | } 46 | }, 47 | "require": { 48 | "php": ">=7.4|^8.0" 49 | }, 50 | "scripts": { 51 | "post-package-update": [ 52 | "php artisan vendor:publish --provider=Miladimos\\Repository\\Providers\\RepositoryServiceProvider --tag=repository-stubs --force", 53 | "php artisan vendor:publish --provider=Miladimos\\Repository\\Providers\\RepositoryServiceProvider --tag=repository-config --force" 54 | ] 55 | }, 56 | "license": "MIT" 57 | } 58 | -------------------------------------------------------------------------------- /config/repository.php: -------------------------------------------------------------------------------- 1 | getNamespace() 8 | */ 9 | 'application_namespace' => 'App', 10 | 11 | /** 12 | * Path that contains Models 13 | * 14 | * application_namespace + \ + models_namespace ==> App\Models 15 | */ 16 | 'models_namespace' => 'Models', 17 | 18 | /** 19 | * Path that contains Repositories 20 | * 21 | * application_namespace + repositories_namespace ==> App\Repositories 22 | * 23 | */ 24 | 'repositories_namespace' => 'Repositories', 25 | 26 | /** 27 | * Path that contains Repository Interfaces 28 | * 29 | * application_namespace + repositories_namespace ==> App\Repositories\Interfaces; 30 | */ 31 | 'interfaces_namespace' => 'Interfaces', 32 | 33 | /** 34 | * Suffix for Created Repositories 35 | * 36 | * ex: $modelNameRepository 37 | * 38 | */ 39 | 'repositories_suffix' => 'Repository', 40 | 41 | /** 42 | * Suffix for Created Repositories 43 | * 44 | * ex: $modelNameInterface 45 | * 46 | */ 47 | 'interfaces_suffix' => 'Interface', 48 | 49 | 50 | 'caching' => [ 51 | 'enabled' => false, 52 | ] 53 | ]; 54 | -------------------------------------------------------------------------------- /src/Console/Commands/InstallPackageCommand.php: -------------------------------------------------------------------------------- 1 | info("laravel-repository package installing started..."); 20 | 21 | //config 22 | if (File::exists(config_path('repository.php'))) { 23 | $confirmConfig = $this->confirm("repository.php already exist. you must overwrite it! Are you ok?"); 24 | if ($confirmConfig) { 25 | $this->publishConfig(); 26 | $this->info("config publish/overwrite finished"); 27 | } else { 28 | $this->error("you must publish or overwrite config file"); 29 | die; 30 | } 31 | } else { 32 | $this->publishConfig(); 33 | $this->info("config published"); 34 | } 35 | 36 | // stub files 37 | $confirmStub = $this->confirm("Do you like publish stubs files?"); 38 | if ($confirmStub) { 39 | if (File::isDirectory(resource_path('vendor/miladimos/repository/stubs'))) { 40 | $confirmConfig = $this->confirm("stubs files already exist. you must overwrite it! Are you ok?"); 41 | if ($confirmConfig) { 42 | $this->publishStubs(); 43 | $this->info("stubs publish/overwrite finished"); 44 | } else { 45 | $this->error("you must publish and overwrite stubs file"); 46 | die; 47 | } 48 | } 49 | $this->publishStubs(); 50 | $this->info("stub files published!"); 51 | } else { 52 | die; 53 | } 54 | 55 | $this->info("repository package installed successfully! please star me on github!"); 56 | $this->info("https://github.com/miladimos/laravel-repository"); 57 | 58 | return 0; 59 | } 60 | 61 | private function publishConfig() 62 | { 63 | $this->call('vendor:publish', [ 64 | '--provider' => "Miladimos\Repository\Providers\RepositoryServiceProvider", 65 | '--tag' => "repository-config", 66 | '--force' => true, 67 | ]); 68 | } 69 | 70 | private function publishStubs() 71 | { 72 | $this->call('vendor:publish', [ 73 | '--provider' => "Miladimos\Repository\Providers\RepositoryServiceProvider", 74 | '--tag' => "repository-stubs", 75 | '--force' => true, 76 | ]); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeRepositoryCommand.php: -------------------------------------------------------------------------------- 1 | modelName = trim(Str::studly($this->argument('model'))); 30 | 31 | $this->warn("Repository {$this->modelName} is creating ..."); 32 | 33 | try { 34 | 35 | if ((new self)->ensureRepositoryDoesntAlreadytExist($this->modelName)) { 36 | $msg = ' ""' . (new self)->getRepositoryPath($this->modelName) . '""' . " already exist. you must overwrite it! Are you ok?"; 37 | 38 | $confirm = $this->confirm($msg); 39 | if ($confirm) { 40 | if (Repository::make($this->modelName)) { 41 | $this->info("{$this->modelName}Repository.php overwrite finished"); 42 | die; 43 | } else { 44 | $this->error('Error in overwriting Repository!'); 45 | die; 46 | } 47 | } else { 48 | $this->modelName = $this->ask("Enter the Repository another file name? "); 49 | } 50 | } 51 | 52 | if (Repository::make($this->modelName)) { 53 | $this->info("Repository file: {$this->modelName} is created successfully."); 54 | die; 55 | } else { 56 | $this->error('Error in creating Repository!'); 57 | die; 58 | } 59 | } catch (\Exception $exception) { 60 | $this->error($exception); 61 | die; 62 | } 63 | 64 | return 0; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Console/Commands/MakeRepositoryProviderCommand.php: -------------------------------------------------------------------------------- 1 | name = trim(Str::studly($this->argument('name'))); 28 | 29 | $this->warn("Serivce Provider {$this->name} is creating..."); 30 | 31 | try { 32 | 33 | if (Repository::createProvider($this->name)) { 34 | $this->info("Service Provider: {$this->name} is created successfully."); 35 | } else { 36 | $msg = ' ""' . $this->name . '""' . " already exist. do you want create another?"; 37 | $confirm = $this->confirm($msg); 38 | if ($confirm) { 39 | $this->name = $this->ask("Enter the Provider name? "); 40 | if (Repository::createProvider($this->name)) { 41 | $this->info("Service Provider file: {$this->name} is created successfully."); 42 | } else { 43 | $this->error("error"); 44 | die; 45 | } 46 | } else { 47 | $this->warn("You must have a Provider for Repositories. create it"); 48 | die; 49 | } 50 | } 51 | } catch (\Exception $exception) { 52 | $this->error($exception); 53 | die; 54 | } 55 | 56 | return 0; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/Console/Stubs/RepositoryInterface.stub: -------------------------------------------------------------------------------- 1 | repositories as $repository) { 23 | $this->app->bind($repository[0], $repository[1]); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/Console/Stubs/repository.stub: -------------------------------------------------------------------------------- 1 | mergeConfigFrom(__DIR__ . "/../../config/repository.php", 'repository'); 16 | 17 | $this->registerFacades(); 18 | } 19 | 20 | public function boot() 21 | { 22 | if ($this->app->runningInConsole()) { 23 | 24 | $this->registerPublishes(); 25 | 26 | $this->registerCommands(); 27 | } 28 | } 29 | 30 | private function registerFacades() 31 | { 32 | $this->app->bind('repository', function ($app) { 33 | return new Repository(); 34 | }); 35 | } 36 | 37 | private function registerPublishes() 38 | { 39 | $this->publishes([ 40 | __DIR__ . '/../../config/repository.php' => config_path('repository.php') 41 | ], 'repository-config'); 42 | 43 | $this->publishes([ 44 | __DIR__ . '/../Console/Stubs' => resource_path('vendor/miladimos/repository/stubs'), 45 | ], 'repository-stubs'); 46 | } 47 | 48 | public function registerCommands() 49 | { 50 | $this->commands([ 51 | InstallPackageCommand::class, 52 | MakeRepositoryCommand::class, 53 | MakeRepositoryProviderCommand::class, 54 | ]); 55 | } 56 | 57 | /** 58 | * Check if package is running under Lumen app 59 | * 60 | * @return bool 61 | */ 62 | protected function isLumen() 63 | { 64 | return str_contains($this->app->version(), 'Lumen') === true; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/Repositories/BaseRepository.php: -------------------------------------------------------------------------------- 1 | app = app(); 19 | 20 | $this->makeModel(); 21 | } 22 | 23 | abstract public function model(); 24 | 25 | final public function makeModel() 26 | { 27 | return $this->setModel($this->model()); 28 | } 29 | 30 | /** 31 | * @param $column 32 | * @return mixed 33 | */ 34 | final public function setModel(Model $model) 35 | { 36 | $this->newInstanceModel = $this->app->make($model); 37 | 38 | if (!$this->newInstanceModel instanceof Model) 39 | throw new Exception("Class {$this->newInstanceModel} must be an instance of Illuminate\\Database\\Eloquent\\Model"); 40 | 41 | return $this->model = $this->newInstanceModel; 42 | } 43 | 44 | /** 45 | * return current model 46 | * 47 | * @return Model 48 | */ 49 | public function getModel(): Model 50 | { 51 | return $this->model; 52 | } 53 | 54 | /** 55 | * @param $column 56 | * @return object 57 | */ 58 | public function all($columns = ['*']): object 59 | { 60 | return $this->model->all($columns); 61 | } 62 | 63 | /** 64 | * @param $column 65 | * @return object 66 | */ 67 | public function create(array $data) 68 | { 69 | return $this->model->create($data); 70 | } 71 | 72 | /** 73 | * @param $column 74 | * @return mixed 75 | */ 76 | public function update(array $data, $id, $attribute = "id") 77 | { 78 | $keys = ['_token', '_method', 'XDEBUG_SESSION_START']; 79 | foreach ($keys as $key) { 80 | if (array_key_exists($key, $data)) { 81 | unset($data[$key]); 82 | } 83 | } 84 | 85 | $updated = $this->model 86 | ->where($attribute, '=', $id) 87 | ->update($data); 88 | 89 | if (!$updated) { 90 | throw new Exception( 91 | "Update model {$this->model()} was unsuccessful" 92 | ); 93 | } 94 | 95 | return $updated; 96 | } 97 | 98 | /** 99 | * @param $column 100 | * @return mixed 101 | */ 102 | public function find($id): object 103 | { 104 | return $this->model->find($id); 105 | } 106 | 107 | /** 108 | * @param $column 109 | * @return mixed 110 | */ 111 | public function findOrFail($id): ?object 112 | { 113 | return $this->model->findOrFail($id); 114 | } 115 | 116 | /** 117 | * @param $column 118 | * @return mixed 119 | */ 120 | public function findWhere(string $field, $condition, $columns) 121 | { 122 | return $this->model->where($field, $condition, $columns); 123 | } 124 | 125 | /** 126 | * @param $column 127 | * @return mixed 128 | */ 129 | public function first(): object 130 | { 131 | return $this->model->first(); 132 | } 133 | 134 | /** 135 | * @param $column 136 | * @return mixed 137 | */ 138 | public function last(): object 139 | { 140 | return $this->model->latest()->first(); 141 | } 142 | 143 | /** 144 | * @param $column 145 | * @return mixed 146 | */ public function next($id): object 147 | { 148 | return $this->model->where('id', '>', $id)->orderBy('id')->first(); 149 | } 150 | 151 | /** 152 | * @param $column 153 | * @return mixed 154 | */ public function before($id): object 155 | { 156 | return $this->model->where('id', '<', $id)->orderBy('id', 'desc')->first(); 157 | } 158 | 159 | /** 160 | * @param $column 161 | * @return mixed 162 | */ 163 | public function firstOrCreate($attributes, $values) 164 | { 165 | // return $this->firstOrCreate(); 166 | } 167 | 168 | /** 169 | * @param $column 170 | * @return mixed 171 | */ 172 | public function whereIn($attribute, array $values) 173 | { 174 | return $this->model->whereIn($attribute, $values)->get(); 175 | } 176 | 177 | /** 178 | * @param $column 179 | * @return mixed 180 | */ 181 | public function max($column) 182 | { 183 | return $this->model->max($column); 184 | } 185 | 186 | /** 187 | * @param $column 188 | * @return mixed 189 | */ 190 | public function min($column) 191 | { 192 | return $this->model->min($column); 193 | } 194 | 195 | /** 196 | * @param $column 197 | * @return mixed 198 | */ 199 | public function avg($column) 200 | { 201 | return $this->model->avg($column); 202 | } 203 | 204 | /** 205 | * @param $column 206 | * @return mixed 207 | */ 208 | public function delete($id) 209 | { 210 | $status = $this->model->destroy($id); 211 | if (!$status and !is_array($id) and !empty($id)) { 212 | throw new Exception( 213 | "Unable to delete {$this->model()} with id: {$id}" 214 | ); 215 | } 216 | return $status; 217 | } 218 | 219 | /** 220 | * @param $column 221 | * @return mixed 222 | */ 223 | public function truncate() 224 | { 225 | return $this->model->truncate(); 226 | } 227 | 228 | /** 229 | * @param $column 230 | * @return mixed 231 | */ 232 | public function count($columns = ['*']): int 233 | { 234 | return $this->model->count($columns); 235 | } 236 | 237 | /** 238 | * @param $column 239 | * @return mixed 240 | */ 241 | public function paginate($columns = ['*'], $perPage = 8) 242 | { 243 | return $this->model->paginate($perPage, $columns); 244 | } 245 | 246 | /** 247 | * @param $column 248 | * @return mixed 249 | */ 250 | public function simplePaginate($limit = null, $columns = ['*']) 251 | { 252 | return $this->model->simplePaginate($limit, $columns); 253 | } 254 | 255 | /** 256 | * @param $column 257 | * @return mixed 258 | */ 259 | public function search(array $query, $columns = ["*"]) 260 | { 261 | // 262 | } 263 | 264 | /** 265 | * @param $value 266 | * @param $key 267 | * @return mixed 268 | */ 269 | public function pluck($value, $key = null) 270 | { 271 | $lists = $this->model->pluck($value, $key); 272 | 273 | if (is_array($lists)) { 274 | return $lists; 275 | } 276 | 277 | return $lists->all(); 278 | } 279 | 280 | /** 281 | * Eager load database relationships 282 | * @param $column 283 | * @return mixed 284 | */ 285 | public function with($relations) 286 | { 287 | return $this->model->with($relations); 288 | } 289 | 290 | /** 291 | * @param $column 292 | * @return mixed 293 | */ 294 | public function toSql() 295 | { 296 | return $this->model->toSql(); 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /src/Repositories/IBaseEloquentRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | getRepositoryDefaultDirectory())) 69 | mkdir($path, 0777, true); 70 | 71 | self::createRepository($modelName); 72 | self::createInterface($modelName); 73 | 74 | return true; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/Traits/GetStubs.php: -------------------------------------------------------------------------------- 1 | getRepositorySuffix($model) . '.php'); 15 | } 16 | 17 | protected function getRepositoryDefaultDirectory() 18 | { 19 | $repositoryNamespace = config('repository.repositories_namespace') ?? 'Repositories'; 20 | return app_path($repositoryNamespace); 21 | } 22 | 23 | protected static function getRepositoryDefaultNamespace($full = true) 24 | { 25 | $appNamespace = config('repository.base_app_namespace') ?? 'App'; 26 | $repositoryNamespace = config('repository.repositories_namespace') ?? 'Repositories'; 27 | if ($full) 28 | return $appNamespace . '\\' . $repositoryNamespace . ';'; 29 | 30 | return $appNamespace . '\\' . $repositoryNamespace; 31 | } 32 | 33 | protected static function getRepositorySuffix($model) 34 | { 35 | $repotisorySuffix = config('repositories.repositories_suffix') ?? 'Repository'; 36 | return $model . $repotisorySuffix; 37 | } 38 | 39 | protected static function getRepositoryInterfaceSuffix($model) 40 | { 41 | $interfaceSuffix = config('repositories.interfaces_suffix') ?? 'Interface'; 42 | return $model . $interfaceSuffix; 43 | } 44 | 45 | protected static function getModelClassName($model) 46 | { 47 | return trim(Str::studly($model)); 48 | } 49 | 50 | protected static function getModelNamespace($model) 51 | { 52 | $appNamespace = config('repository.base_app_namespace') ?? 'App'; 53 | $modelNamespace = config('repository.models_namespace') ?? 'Models'; 54 | 55 | return $appNamespace . '\\' . $modelNamespace . '\\' . $model . ';'; 56 | } 57 | 58 | protected static function getModelPath($model) 59 | { 60 | $modelNamespace = config('repository.models_namespace') ?? 'Models'; 61 | 62 | return app_path($modelNamespace . '//' . $model); 63 | } 64 | 65 | protected static function getInterfaceNamespace($model) 66 | { 67 | $appNamespace = config('repository.base_app_namespace') ?? 'App'; 68 | $repositoryNamespace = config('repository.repository_namespace') ?? 'Repositories'; 69 | 70 | return $appNamespace . '\\' . $repositoryNamespace . '\\' . $model; 71 | } 72 | 73 | protected static function getRepositoryInterfaceNamespace($model) 74 | { 75 | $appNamespace = config('repository.base_app_namespace') ?? 'App'; 76 | $repositoryNamespace = config('repository.repository_namespace') ?? 'Repositories'; 77 | 78 | return $appNamespace . '\\' . $repositoryNamespace . '\\' . $model . '\\' . $model; 79 | } 80 | 81 | protected static function getRepositoryNamespace($model) 82 | { 83 | $appNamespace = config('repository.base_app_namespace') ?? 'App'; 84 | $repositoryNamespace = config('repository.repository_namespace') ?? 'Repositories'; 85 | 86 | return $appNamespace . '\\' . $repositoryNamespace . '\\' . $model; 87 | } 88 | 89 | 90 | protected static function getRepositoryServiceProviderPath($providerName) 91 | { 92 | $ds = DIRECTORY_SEPARATOR; 93 | return app_path("Providers{$ds}{$providerName}.php"); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/Traits/Validation.php: -------------------------------------------------------------------------------- 1 | getRepositoryPath($model))) { 10 | return true; 11 | } 12 | return false; 13 | } 14 | 15 | public static function ensureRepositoryServiceProviderDoesntAlreadytExist($providerName) 16 | { 17 | if (file_exists(self::getRepositoryServiceProviderPath($providerName))) { 18 | return false; 19 | } 20 | return true; 21 | } 22 | } 23 | --------------------------------------------------------------------------------