Download the PHP package hyder/facade-pattern without Composer

On this page you can find all versions of the php package hyder/facade-pattern. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package facade-pattern

Laravel Facade Pattern Scaffolding

This package provides scaffolding for the Facade Pattern in Laravel. The Facade Pattern is a design pattern that helps to separate the business logic from the controller or other client code, making it easier to maintain and test.

Why Facade Pattern instead of Repository Pattern?

In the Repository Pattern, the implementation of the data access layer is abstracted behind an interface. This interface defines the methods that the repository must implement, but it doesn't provide any way to access the underlying implementation details.

This lack of flexibility can be problematic in cases where you need to access the implementation details of the repository from other parts of the code. For example, if you need to access the repository from within a queued job or another simple class, you can't simply create a new instance of the repository because it's abstracted behind an interface.

One workaround for this issue is to pass the repository instance to the queued job or simple class as a parameter, but this can lead to tight coupling and make the code harder to maintain.

Another workaround is to use a dependency injection container to provide an instance of the repository to the queued job or simple class. However, this can add additional complexity and require additional configuration.

Overall, the lack of flexibility in the Repository Pattern can be a disadvantage in certain situations, especially when you need to access the implementation details of the repository from other parts of the code.

Here comes the solution with Facade Pattern. You can easily access the Facade from within a queued job or another simple class.

Installation

You can install the package via composer:

Publish Provider

After installation, you need to run the vendor:publish command to publishing provider file. You can do this by running the following command:

This will publish the package's FacadeServiceProvider to the app/Providers directory, which you can then modify as needed.

The FacadeServiceProvider class is responsible for registering the service classes for Facade with the Laravel container. This allows you to easily swap out the implementation of the service classes if needed.

Configuration

You have to manually add the service provider in your config/app.php file:

Create Scaffolding

Now you can run the facade-pattern:scaffold command to generate the necessary scafolding files. You can do this by running the following command:

This will create the following files in your app directory:

Create Facade, Interface and Service

By running the facade-pattern:facade, facade-pattern:interface, and facade-pattern:service command you can generate the necessary file. You can do this by running the following command:

Facade

Interface

Service

Don't forget to register your facade service class in FacadeServiceProvider provider's register() method.
That's it! You can now start using the Facade Pattern in your Laravel application.

Contributing

If you would like to contribute to this package, please create a pull request or open an issue.

License

This package is open-source software released under the MIT license. Feel free to modify and use the package in your own projects.


All versions of facade-pattern with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hyder/facade-pattern contains the following files

Loading the files please wait ....