Download the PHP package yanmarques/cloudpaths without Composer
On this page you can find all versions of the php package yanmarques/cloudpaths. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yanmarques/cloudpaths
More information about yanmarques/cloudpaths
Files in yanmarques/cloudpaths
Package cloudpaths
Short Description A mapper to create paths for cloud storage
License MIT
Informations about the package cloudpaths
Cloudpaths for Laravel
A mapper to create dynamic urls for storing data on cloud.
Table of Contents
- Installing
- Running tests
- Getting Started
- Api
- Mapping a new directory
- Mapping an array
- Find a directory
- Find a directory replacing dynamic directories
Installing
To install you can add as a dependency for your project with composer.
Running tests
Tests are good for any project, skipping tests may kill kittens.
Getting Started
Register the Service Provider
The package registers itself using the service provider. For this you must add the service provider to the list on your .
Facades (Optional)
Laravel allows us to use Facade classes as aliases for registered services on the application container. To use the Cloudpaths Facade class you must add the Facade path to the of the .
Configuration
Once the service provider has been registered the Cloudpaths application, it will try to read the configuration from file. To configure it, you must publish the configuration file to the path. Open the console and run on your project:
Cloudpaths
The Cloudpaths class is a mapper class, which maps each directory as directory classes that implements the interface. When a new directory is been mapped, a new directory class is created, with their subdirectories, also composed by directory classes.
The collects a bunch of directories that implements the directory interface. It extends the wonderfull from Laravel, inheriting it's methods. Although the collection proxies the method that stores a new item to accepts only directory items.
- To create a new cloudpaths instance: `
To build a new directory and it's subdirectories, the Cloudpaths uses a Factory class to handle this operation. The factory implements the interface. The default factory is the Factory implementation, but you can implement your and pass as second argument to Cloudpaths.
Example:
Searcher
The searcher is a search engine implemention to find for a directory by name on a given collection scope. The search engine uses scopes to change the search view. The scope will be a directory collection where only the current scope is the search target, when the scope is changed, the search is also changed.
You can implement your own searcher that implements the interface and provide as the third argument for Cloudpaths. The default searcher is the .
Example:
Api
Mapping a new directory:
Mapping an array of directories:
Find a directory path by dot notation input.
You do not have to instruct the full path to the directory, just the top level directory where the directory is located and the target directory, we will find it :).
Find a directory replacing a dynamic directory name
To replace, you provide an array with a key/value, the key represent the key to find and the value is the value to replace.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
All versions of cloudpaths with dependencies
illuminate/contracts Version 5.5.*|5.6.*
illuminate/support Version 5.5.*|5.6.*
illuminate/config Version 5.5.*|5.6.*
illuminate/pipeline Version ^5.6