PHPackages                             opoink/oliv - 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. [Framework](/categories/framework)
4. /
5. opoink/oliv

ActiveLibrary[Framework](/categories/framework)

opoink/oliv
===========

opoink laravel inertia vue

v0.0.9(4mo ago)045mitJavaScript

Since Mar 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/opoink/oliv)[ Packagist](https://packagist.org/packages/opoink/oliv)[ RSS](/packages/opoink-oliv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (10)Used By (0)

Getting Started
---------------

[](#getting-started)

Installation
------------

[](#installation)

- Requirements
    - PHP 8.3 and up
    - Node v18.17.0, v23.5.0
    - MySQL: this package is created using MySQL version 9.1.0 - MySQL Community Server - GPL
- Install Laravel 11.31.x and above without a starter kit, see Laravel's [documentation](https://laravel.com/docs)
    - `Would you like to install a starter kit? [No starter kit]:`
    - `Which database will your application use? [mysql]`
    - `Default database updated. Would you like to run the default database migrations? (yes/no) [no]`
- Install [oliv](https://github.com/opoink/oliv) package `composer require opoink/oliv`
    - Let Laravel discover the Oliv package `php artisan package:discover` if not discovered yet
    - run the command `php artisan oliv:install` this will initiate all required files
- (optional) change the value of the `VITE_ADMIN_URL` of your choice
- (optional) Change the value of the `VITE_INERTIA_SSR_PORT` in `ecosystem.config.js` of your choice
- Update database host, user, pass, name
- create file `plugins/config.json` you can copy it from `plugins/config.sample.json`
- run the command `php artisan oliv:plugins-update` this will compile and update all plugins set at the config.json file
- Optional `php artisan migrate` to migrate database
- run command `npm install` or `npm i`

Run laravel
-----------

[](#run-laravel)

- `php artisan serve`

Run InertiaJS
-------------

[](#run-inertiajs)

- `npm run dev`

Build InertiaJS App
-------------------

[](#build-inertiajs-app)

- build only: `npm run build`
- build with SSR: `npm run build:ssr`
- using php artisan: `php artisan inertia:start-ssr`
- using pm2: `pm2 start ecosystem.config.js`

Commands
--------

[](#commands)

- `php artisan oliv:plugins-update`
- Please refer to Laravel documentation for the rest of the command

Clear the View Cache
--------------------

[](#clear-the-view-cache)

- `php artisan view:clear`: run this command if the domain URL is changed, or a new route is added

Global Components
-----------------

[](#global-components)

In the `plugins///resources/js/GlobalComponents` add your vue component file with ext of lowercase `.vue`

e.g `NewComponent.vue` then you can call it on your vue template as ``

If you add a vue file into sub-directories e.g `plugins///resources/js/GlobalComponents/Blog/Post/Comments.vue` then you can call it in your template as ``

All global components are ready and available in all Vue templates.

Note: run `php artisan oliv:plugins-update` every time a new Global Component file is added or removed

Event/Listeners
---------------

[](#eventlisteners)

- On your plugin create a directory `EventListeners` e.g. `plugins///EventListeners`
- Inside `EventListeners` create a file `EventList.php````

    ```
- Create event listener class in `plugins///EventListeners/````
