Download the PHP package eghamat24/database-repository without Composer

On this page you can find all versions of the php package eghamat24/database-repository. 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 database-repository

Database Repository / PHP Repository / Laravel Repository

Installation

Use the following command to add this package to the composer development requirement.

Setup Laravel Repository

Then run the following command in the console to publish the necessary assets in your project directory.

Setup Lumen Repository

Navigate to app.php in bootstrap folder and add the following line after service providers registrations:

Copy repository.php to the project config folder located at the project root.

Note: Make sure to run composer dump-autoload after these changes.

Usage

To use this package easily, you can run the following command. It will create all the required components such as Entity, IRepository, Repository, MySqlRepository, RedisRepository, Resource, and Factory for the users table.

List of artisan commands:

Command Inputs Options Description
repository:make-entity table_name -f, -d, -k, -g Create new Entity
repository:make-enum table_name -f, -d, -g Create new Enum
repository:make-factory table_name -f, -d, -g Create new Factory
repository:make-resource table_name -f, -d, -k, -g Create new Resource
repository:make-interface-repository table_name -f, -d, -k, -g Create new Repository Interface
repository:make-repository table_name, selected_db(optional) -f, -d, -k, -g Create new Base Repository
repository:make-mysql-repository table_name -f, -d, -k, -g Create new MySql Repository class
repository:make-redis-repository table_name -f, -d, -k, -g Create new Redis Repository class
repository:make-all --table_names=table_names(optional)
--selected_db=database(optional)
-a, -f, -d, -k, -g Run all of the above commands

Options Explanation

Example 1. Create a new Entity for a table named 'users'.

Example 2. Create all necessary classes for two tables named 'users' and 'customers' with an enabled foreign key option.

Example 3. Create all necessary classes for all tables with an enabled foreign key option(this may be used for new projects).

Cache Strategy

We created some strategies for caching data, based on the number of records and change frequency

SingleKeyCacheStrategy

SingleKeyCacheStrategy is a good choice for tables with very few rows, such as less than 50 records. This strategy creates one cache key and stores all the data on it. Then, when the app queries data, it loops through the data and returns the result.

This strategy has one cache key and clears all the cached data whenever there is a change. This ensures that the data is always updated and valid.

QueryCacheStrategy

QueryCacheStrategy is suitable for tables that have low change frequency and not too many records. For example, if the table has less than 10,000 rows or if it has more than that but the queries are not very unique and there are similar queries, this strategy works well.

This strategy assigns a tag to each cache of the repository and clears all the cached data whenever there is a change. This ensures that the data is always updated and valid.

TemporaryCacheStrategy

TemporaryCacheStrategy is useful when we have a large or diverse amount of data and the data user can tolerate some delay in the updates. We cache every request and delay the changes that are not critical to be reflected in real time. For example, if we have a post and we edit its content, we can cache the old version until the cache expires. We set the cache expiration time for each data item based on the maximum delay the user can accept. This way, we use this strategy to cache data temporarily.

ClearableTemporaryCacheStrategy

Sometimes, we need to clear the data from a temporary cache when some critical changes occur. ClearableTemporaryCacheStrategy is suitable for these situations.


All versions of database-repository with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-pdo Version *
ext-json Version *
illuminate/console Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/cache Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.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 eghamat24/database-repository contains the following files

Loading the files please wait ....