PHPackages                             durnerlys/dummy-quotes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. durnerlys/dummy-quotes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

durnerlys/dummy-quotes
======================

This package is used to obtain random phrases from an external public API.

v1.0.0(1y ago)06MITPHPPHP ^8.2CI failing

Since May 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/durnerlysdev/dummy-quotes)[ Packagist](https://packagist.org/packages/durnerlys/dummy-quotes)[ Docs](https://github.com/durnerlysdev/dummy-quotes)[ GitHub Sponsors](https://github.com/durnerlys)[ RSS](/packages/durnerlys-dummy-quotes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (2)Used By (0)

 [Español / Spanish](./LEAME.md)

Dummy Quotes
============

[](#dummy-quotes)

This Laravel package provides a user interface built with Vue.js to interact with the [DummyJSON Quotes](https://dummyjson.com/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
------------

[](#installation)

You can install this package via Composer:

```
composer require durnerlys/dummy-quotes
```

Publishing Assets
-----------------

[](#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):**

```
php artisan vendor:publish --provider="Durnerlys\DummyQuotes\DummyQuotesServiceProvider"
```

**Or, if you prefer to publish by specific tags:**

```
# API Routes
php artisan vendor:publish --tag="dummy-quotes-routes"

# Blade View (Entry to Vue views)
php artisan vendor:publish --tag="dummy-quotes-views"

# Vue.js Sources (folder 'resources/js')
php artisan vendor:publish --tag="dummy-quotes-vue-sources"

# Compiled Assets (Vue 'dist' folder)
php artisan vendor:publish --tag="dummy-quotes-assets"
```

Dependencies
------------

[](#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:**

- `vue`: (Minimum recommended version: `^3.5.13` or the version used by this package). Necessary to render the Vue components provided by this package.

    ```
    npm install vue@^3.5.13
    # or
    yarn add vue@^3.5.13
    ```
- `vue-router`: (Minimum recommended version: `^4.5.1` or the version used by this package). Required because this package uses Vue Router within its components.

    ```
    npm install vue-router@^4.5.1
    # or
    yarn add vue-router@^4.5.1
    ```

    **Other CSS/UI Dependencies:**
- `bootstrap`: (Minimum recommended version: `^5.3.5` or the version used by this package). Necessary because the components in this package utilize Bootstrap styles.

    ```
    npm install bootstrap@^5.3.5
    # or
    yarn add bootstrap@^5.3.5
    ```

**Package-Specific Vue Libraries:**

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

```
npm install vue-paginate
# or
yarn add vue-paginate
```

### Vite Configuration for Package Vue Assets

[](#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:

    ```
    npm install vite @vitejs/plugin-vue --save-dev
    # or
    yarn add vite @vitejs/plugin-vue --dev
    ```
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.**

    ```
    import { defineConfig } from "vite";
    import laravel from "laravel-vite-plugin";
    import vue from "@vitejs/plugin-vue"; //
