Laravel Manager - provides some manager functionality for Laravel

Overview

Laravel Manager

Laravel Manager was created by, and is maintained by Graham Campbell, and provides some manager functionality for Laravel. Feel free to check out the change log, releases, security policy, license, code of conduct, and contribution guidelines.

Banner

Build Status StyleCI Status Software License Packagist Downloads Latest Version

Installation

Laravel Manager requires PHP 7.1-8.1. This particular version supports Laravel 5.5-9.

Manager L5.1 L5.2 L5.3 L5.4 L5.5 L5.6 L5.7 L5.8 L6 L7 L8 L9
2.5
3.0
4.7

To get the latest version, simply require the project using Composer:

$ composer require "graham-campbell/manager:^4.7"

Once installed, you can extend or implement the classes in this package to speed up writing Laravel packages further. There are no service providers to register.

Configuration

Laravel Manager requires no configuration. Just follow the simple install instructions and go!

Usage

ConnectorInterface

This interface defines one public method.

The 'connect' method accepts one parameter which is an array of config.

This interface is not used by this package, but is used by Laravel Flysystem.

ManagerInterface

This interface defines the public methods a manager class must implement.

The 'connection' method accepts one optional parameter (the connection name), and will return a connection instance and will reuse a previous connection from the pool if possible.

The 'reconnect' method accepts one optional parameter (the connection name), and will return a connection instance after forcing a re-connect.

The 'disconnect' method accepts one optional parameter (the connection name), and will return nothing after removing the connection from the pool.

The 'getConnectionConfig' method has one required parameter (the connection name), and will return the config for the specified connection.

The 'getDefaultConnection' method will return the default connection as specified in the config.

The 'setDefaultConnection' method has one required parameter (the connection name), and will return nothing after setting the default connection.

The 'extend' method has two required parameter. The first is the name of a connection, or the name of a connection driver. The second parameter must be callable. The purpose of this method is to add custom connection creation methods on the fly. The second parameter must return a connection.

The 'getConnections' method will return an array of all the connections currently in the pool.

AbstractManager

This abstract class implements the ManagerInterface. It has two abstract protected methods that must be implemented by extending classes.

The 'createConnection' method will be called with the specific connection config as the first parameter. It must return a connection instance.

The 'getConfigName' method must return the name of the connection config. This may be 'yourname\yourpackage' for example.

You can also dynamically call methods on the default connection due to the use of __call so instead of writing ->connection()->methodName(), you can just jump straight in with ->methodName().

Further Information

You may see an example of implementation in Laravel Flysystem, Laravel DigitalOcean, and Laravel GitHub.

Security

If you discover a security vulnerability within this package, please send an email to [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

Laravel Manager is licensed under The MIT License (MIT).

For Enterprise

Available as part of the Tidelift Subscription

The maintainers of graham-campbell/manager and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Comments
  • Allow use with Laravel 5.5

    Allow use with Laravel 5.5

    Laravel 5.5 isn't released yet, but lots of people (including me) are already using it. This PR allows the use of this package with Laravel 5.5

    Also, please release a new version of this package (you can release a patch or a minor version) when you merge this PR, to avoid pulling dev-master.

    opened by m1guelpf 5
  • Dynamically create FTP connection config

    Dynamically create FTP connection config

    Hi, just wondering if you could assist with how to create an FTP connection dynamically, e.g FTP details are stored on a Model and I want to create a new connection at runtime rather than stored in the config/flysystem.php

    The facade doesn't implement the createConnection method so I am having trouble figuring it out.

    Thanks

    opened by njbarrett 4
  • [PR] Did you unsubscribe?

    [PR] Did you unsubscribe?

    @GrahamCampbell - I saw in the past you usually respond quickly, and you're committing to various other repos recently. That leads me to believe that you probably unsubscribed to notifications on PRs for your repos on GitHub.

    This is just a friendly reminder that about 5 days ago I sent a couple PRs to your Laravel-Manager and Laravel-DigitalOcean repos on here to bump the version to Laravel 5.7 as it's max, while still retaining the ability for people to update it on 5.5 and 5.6.

    opened by rickmacgillis 3
  • Unable to test facade when class extends AbstractManager

    Unable to test facade when class extends AbstractManager

    Hey Graham, I am currently attempting to write some tests revolving around Vimeo upload functionality. I am using vinkla/laravel-vimeo to accomplish this. During my tests I am attempting to mock the Vimeo facade. The VimeoManger that the facade delivers extends your AbstractManager class. The issue ultimately comes down to the fact that the Mock class expects the __call() method's signature to to be the same.

    I have a feeling most classes that use facades don't implement that magic method, so it generally isn't a problem.

    The mock class expects the signature: __call($method, array $args)

    whereas AbstractManager has: __call(string $method, array $parameters)

    Attempting to override your method within the VimeoManager doesn't work. However, simply updating your __call() method does. I'm curious if I can create a pull request to literally just change out the signature? I don't see how this would affect any functionality of the method.

    Thanks!

    opened by brandonferens 3
  • Bumped Laravel maximum version to 5.7.x

    Bumped Laravel maximum version to 5.7.x

    I bumped the version to Laravel 5.7.x after reading through the upgrade guide to verify that your software is compatible with it. Please merge this in and tag it with a new version to allow for our production system to pull the code.

    Also, if you bump the version to something incompatible with the composer.json on your other software that's depending on Laravel-Manager, then be sure to update that. (IMO you'd only really need a "bug fix" version as we're just bumping the Laravel version for forward compatibility.

    opened by rickmacgillis 2
  • removing type hint for __call() method on first arguement

    removing type hint for __call() method on first arguement

    Updating the __call() method on the AbstractManager class. Ran into an error similar to this issue:

    https://stackoverflow.com/questions/21358268/mockery-call-has-a-different-signature.

    Also feel confident this shouldn't be an issue, due to PHP under the hood is automatically type hinting the first argument to a string according to the docs.

    http://php.net/manual/en/language.oop5.overloading.php#object.call

    opened by mikebautista 1
Releases(v4.7.0)
Owner
Graham Campbell
OSS Maintainer | Laravel Core | StyleCI
Graham Campbell
Providing some testing functionality for Laravel

Laravel TestBench Laravel TestBench was created by, and is maintained by Graham Campbell, and provides some testing functionality for Laravel. It util

Graham Campbell 50 Dec 20, 2022
An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Ian Olson 3 Apr 14, 2021
This package extends Laravel's FormBuilder to include some (soon all) HTML5 elements

HTML5 Forms for Laravel This package extends Laravel's FormBuilder to include some (soon all) HTML5 elements. How to Install Install the braunson/lara

Braunson Yager 89 Jun 17, 2022
Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily.

DevMakerLab/Laravel-Filters Need some filters? This package is based on the Repository Design Pattern to let you create specific queries easily. Insta

DevMakerLab 19 Feb 20, 2022
This project is based on the aggregation of jobs from some technology companies.

FIND-JOBS-ALERT ?? ?? ?? This project is based on the aggregation of jobs from some technology companies. Check below, some companies avaliable in pro

Wellisson Ribeiro 2 Dec 1, 2021
Rami's presskit() with some extra conveniences.

presskittie() presskittie() is presskit() by Rami Ismail, but with some conveniences: run and develop it locally with docker deploy it to Github Pages

Juan Uys 14 Oct 31, 2022
A Laravel package that adds a simple image functionality to any Laravel model

Laraimage A Laravel package that adds a simple image functionality to any Laravel model Introduction Laraimage served four use cases when using images

Hussein Feras 52 Jul 17, 2022
Phone number functionality for Laravel

Laravel Phone Adds phone number functionality to Laravel and Lumen based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents

null 2.1k Dec 31, 2022
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About LivewireUI Spotlight LivewireUI Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel application.

Livewire UI 792 Jan 3, 2023
Useful blade components and functionality for most Laravel projects.

laravel-base Note: Package is still in early stages of development, so functionality is subject to change. LaravelBase is a package I've created to pr

Randall Wilk 3 Jan 16, 2022
Added Laravel functionality to Enlightn Security Checker.

Added Laravel functionality to Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

Jorijn Schrijvershof 184 Oct 27, 2022
This project demonstrates the power of soketi's WebSocket functionality in Laravel.

Laravel + soketi = <3 This project demonstrates the power of soketi's WebSocket functionality in Laravel. Installing the project The server requires:

Soketi 35 Dec 24, 2022
Livewire component that brings Spotlight/Alfred-like functionality to your Laravel application.

About Wire Elements Spotlight Wire Elements Spotlight is a Livewire component that provides Spotlight/Alfred-like functionality to your Laravel applic

Wire Elements 790 Dec 27, 2022
Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey.

Laravel Phone Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents Demo Insta

null 2.1k Jan 2, 2023
Added Laravel functionality to Enlightn Security Checker

Added Laravel functionality to Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

Jorijn Schrijvershof 184 Oct 27, 2022
A Simple MOFH clientarea for free like infinityfree and minimal functionality

Project Hustal Project Hustal is a free of cost MOFH clientarea for account management and support services. It have easy to use features and a much l

Mahtab Hassan 10 Feb 15, 2022
Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey

TYPO3 Phone Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey. Installation composer require si

Simon Schaufelberger 3 Oct 25, 2022
A set of filament components with extra functionality & fresh look

Filament Addons A set of filament components with extra functionality & fresh look Pills (Tab Pills) Coming Soon ... Support Filament Installation You

Bezhan Salleh 15 Dec 16, 2022
laravel - Potion is a pure PHP asset manager for Laravel 5 based off of Assetic.

laravel-potion Potion is a pure PHP asset manager for Laravel based off of Assetic. Description Laravel 5 comes with a great asset manager called Elix

Matthew R. Miller 61 Mar 1, 2022