PHP Classes

How to Implement the Laravel Manager Design Pattern Using the Package Manager Laravel Examples: Manage objects that can be accessed using drivers

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-07-10 (2 hours ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
manager-laravel-10-e 1.0The PHP License7Libraries, Design Patterns, PHP 7
Description 

Author

This package can manage objects that can be accessed using drivers.

It provides an example application that uses the Laravel framework to demonstrate how to implement the manager design pattern.

The application provides an example weather manager class that can be configured to access different driver classes.

The example code demonstrates how to choose a driver class and how to call the functions of the driver classes.

Picture of DeGraciaMathieu
  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 26 packages by
Country: France France
Age: ???
All time rank: 287479 in France France
Week rank: 22 Up1 in France France Up
Innovation award
Innovation award
Nominee: 19x

Winner: 2x

Instructions

Documentation

Manager examples

Project samples for https://github.com/DeGraciaMathieu/Manager


use App\Managers\Weather\WeatherManager;

app(WeatherManager::class)->itsRainingNow('Paris'); // true
# Using the default driver configured by the getDefaultDriver method

app(WeatherManager::class)->driver('openweathermap')->itsRainingNow('Paris'); // true
app(WeatherManager::class)->driver('aerisweather')->itsRainingNow('Paris'); // true

  Files folder image Files (70)  
File Role Description
Files folder imageapp (6 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (16 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (3 files)
Files folder imageresources (2 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file vite.config.js Data Auxiliary data

  Files folder image Files (70)  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 2 directories)
Files folder imageManagers (1 directory)
Files folder imageModels (1 file)
Files folder imageProviders (5 files)

  Files folder image Files (70)  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files (70)  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files (70)  /  app  /  Http  
File Role Description
Files folder imageControllers (1 file)
Files folder imageMiddleware (9 files)
  Plain text file Kernel.php Class Class source

  Files folder image Files (70)  /  app  /  Http  /  Controllers  
File Role Description
  Plain text file Controller.php Class Class source

  Files folder image Files (70)  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file Authenticate.php Class Class source
  Plain text file EncryptCookies.php Class Class source
  Plain text file PreventRequestsDuringMaintenance.php Class Class source
  Plain text file RedirectIfAuthenticated.php Class Class source
  Plain text file TrimStrings.php Class Class source
  Plain text file TrustHosts.php Class Class source
  Plain text file TrustProxies.php Class Class source
  Plain text file ValidateSignature.php Class Class source
  Plain text file VerifyCsrfToken.php Class Class source

  Files folder image Files (70)  /  app  /  Managers  
File Role Description
Files folder imageWeather (2 files, 2 directories)

  Files folder image Files (70)  /  app  /  Managers  /  Weather  
File Role Description
Files folder imageContracts (1 file)
Files folder imageDrivers (2 files)
  Plain text file Repository.php Class Class source
  Plain text file WeatherManager.php Class Class source

  Files folder image Files (70)  /  app  /  Managers  /  Weather  /  Contracts  
File Role Description
  Plain text file Driver.php Class Class source

  Files folder image Files (70)  /  app  /  Managers  /  Weather  /  Drivers  
File Role Description
  Plain text file Aerisweather.php Class Class source
  Plain text file Openweathermap.php Class Class source

  Files folder image Files (70)  /  app  /  Models  
File Role Description
  Plain text file User.php Class Class source

  Files folder image Files (70)  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file BroadcastServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source
  Plain text file RouteServiceProvider.php Class Class source

  Files folder image Files (70)  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source

  Files folder image Files (70)  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file auth.php Class Class source
  Accessible without login Plain text file broadcasting.php Aux. Configuration script
  Accessible without login Plain text file cache.php Aux. Configuration script
  Accessible without login Plain text file cors.php Aux. Configuration script
  Accessible without login Plain text file database.php Aux. Configuration script
  Accessible without login Plain text file filesystems.php Aux. Configuration script
  Accessible without login Plain text file hashing.php Aux. Configuration script
  Plain text file logging.php Class Class source
  Accessible without login Plain text file mail.php Aux. Configuration script
  Accessible without login Plain text file queue.php Aux. Configuration script
  Plain text file sanctum.php Class Class source
  Accessible without login Plain text file services.php Aux. Configuration script
  Accessible without login Plain text file session.php Aux. Configuration script
  Accessible without login Plain text file view.php Aux. Configuration script
  Accessible without login Plain text file weather.php Aux. Configuration script

  Files folder image Files (70)  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (4 files)
Files folder imageseeders (1 file)

  Files folder image Files (70)  /  database  /  factories  
File Role Description
  Plain text file UserFactory.php Class Class source

  Files folder image Files (70)  /  database  /  migrations  
File Role Description
  Plain text file 2014_10_12_000000_create_users_table.php Class Class source
  Plain text file 2014_10_12_100000_...et_tokens_table.php Class Class source
  Plain text file 2019_08_19_000000_...iled_jobs_table.php Class Class source
  Plain text file 2019_12_14_000001_...ss_tokens_table.php Class Class source

  Files folder image Files (70)  /  database  /  seeders  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source

  Files folder image Files (70)  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation

  Files folder image Files (70)  /  resources  
File Role Description
Files folder imagejs (2 files)
Files folder imageviews (1 file)

  Files folder image Files (70)  /  resources  /  js  
File Role Description
  Accessible without login Plain text file app.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.js Data Auxiliary data

  Files folder image Files (70)  /  resources  /  views  
File Role Description
  Accessible without login Plain text file welcome.blade.php Aux. Configuration script

  Files folder image Files (70)  /  routes  
File Role Description
  Accessible without login Plain text file api.php Example Example script
  Accessible without login Plain text file channels.php Example Example script
  Accessible without login Plain text file console.php Example Example script
  Accessible without login Plain text file web.php Aux. Configuration script

  Files folder image Files (70)  /  tests  
File Role Description
Files folder imageFeature (1 file)
Files folder imageUnit (1 file)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files (70)  /  tests  /  Feature  
File Role Description
  Plain text file ExampleTest.php Class Class source

  Files folder image Files (70)  /  tests  /  Unit  
File Role Description
  Plain text file ExampleTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0