Download the PHP package durnerlys/dummy-quotes without Composer

On this page you can find all versions of the php package durnerlys/dummy-quotes. 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 dummy-quotes

Español / Spanish

Dummy Quotes

This Laravel package provides a user interface built with Vue.js to interact with the DummyJSON Quotes API. It offers functionalities such as retrieving all quotes, random quotes, and specific quotes by ID, while also implementing request rate limiting and efficient local caching with binary search.

Installation

You can install this package via Composer:

Publishing Assets

To publish the provider's assets, you can use the following Artisan commands. It is recommended to publish all assets to ensure everything is available in your application.

Publish all provider assets (recommended):

Or, if you prefer to publish by specific tags:

Dependencies

This package utilizes Vue.js for its user interface components. To ensure proper functionality, the Laravel application consuming this package needs to have the following dependencies installed:

Vue Dependencies:

Package-Specific Vue Libraries:

The following libraries are direct dependencies of this package and must be installed in the Laravel application for proper functionality:

Vite Configuration for Package Vue Assets

For the Vue components in this package to function correctly within your Laravel application, you need to ensure that Vite is configured to compile the package's Vue assets within your Laravel application. Follow these steps:

  1. Install Vite and the Vue Plugin: If you haven't already, install the necessary Vite dependencies in your Laravel project:

  2. Create or Modify the vite.config.js File: If it doesn't exist, create a file named vite.config.js in the root of your Laravel project. If it already exists, open it and ensure it contains a configuration similar to the following. It is crucial that you include @vitejs/plugin-vue and the path to your package's scripts entry point in the input option of the Laravel plugin.

    Important Explanation:

    • import vue from '@vitejs/plugin-vue';: This line imports the Vite plugin necessary to process your .vue components. Ensure this import is present at the top of the file.
    • vue(): Ensure that the vue() function is included within the plugins array in the Vite configuration. This enables Vue support in the Vite compilation process.
    • 'resources/vendor/durnerlys/dummy-quotes/js/main.js': This line within the input array of the laravel() plugin tells Vite to also compile the main JavaScript file of your package, and registers all the changes you want to make to the UI design developed in Vue.
  3. Run Vite: After configuring vite.config.js, execute the Vite commands in your Laravel application to compile the assets:

    This command will start the Vite development server and automatically recompile the assets when you save changes. For production, use the command:

    This command will generate the optimized assets in your Laravel application's public/build directory.

  4. Load Assets in your Blade Views: Use the @vite directive in your Laravel Blade files to include the compiled assets of your package:

    Make sure to include the entry point of your editable Vue files ('resources/vendor/durnerlys/dummy-quotes/js/main.js') within the array passed to the @vite directive.

Accessing the UI

To access the package's user interface, go to the following URL in your browser:

Modifying and Recompiling Vue Views

This package includes user interface components developed with Vue.js. If you wish to customize or modify these views, follow these steps:

  1. Locate the Vue Files: The source files for the Vue components of this package, if they have been published to your Laravel application, should be located in the resources/vendor/durnerlys/dummy-quotes/js/components/ directory. Here you will find the .vue files that define the structure, logic, and styling of the components.

  2. Modify the Components: Use your preferred code editor to open and modify the .vue files according to your needs.

  3. Compile Assets with Vite: After making modifications to the Vue files, it is crucial to compile the assets using Vite for the changes to be reflected in your Laravel application. Ensure you are in the root directory of your Laravel project (where the vite.config.js file is located) and run the following command:

    This command will start the Vite development server and automatically recompile the assets when you save changes. For production, use the command:

    This command will generate the optimized assets in your Laravel application's public/build directory.

  4. Visualize the Changes: Once the Vite compilation is complete (without errors), the changes you made to the Vue components should be reflected in your Laravel application when you access the routes or components that utilize the modified views.

Configuration

Flexible configuration file to customize the API URL and rate limiting. Below are the available parameters in this file.

Features

Customer Service API Structure

1. Interfaces

This interface defines the methods that any service retrieving quotes must implement. The methods are:

This interface defines the methods for handling rate limiting of API requests. The methods are:

This interface defines the methods for handling caching. The methods are:

2. Service Classes

This class is the main one and implements QuoteRetrieverInterface, responsible for retrieving quotes from the API. Its methods are:

This class implements CacheServiceInterface and handles the caching logic. Its methods are:

This class implements RateLimiterInterface and handles the rate limiting logic. Its main methods are:

Operation

  1. Quote Retrieval: When a quote is requested, the service first checks if the quote is cached. If it is, it returns it immediately. If not, it makes a request to the API, stores the result in the cache, and returns it.
  2. Rate Limiting: Before making a request to the API, the service checks if the rate limit has been reached. If it has, it returns an error message indicating that too many requests have been made. Rate limit checking has also been added to cached quotes.
  3. Caching: The service uses a caching system to store retrieved quotes, reducing wait time.

Testing

To run the package tests, use the following command:

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of dummy-quotes with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^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 durnerlys/dummy-quotes contains the following files

Loading the files please wait ...