Download the PHP package onpage-dev/laravel-plugin without Composer

On this page you can find all versions of the php package onpage-dev/laravel-plugin. 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 laravel-plugin

On Page ® Laravel plugin

This package implements all the OnPage data and data structure in any Laravel application. All the CLI command have to be execute at your Laravel project main directory.

Installation

Add the repository to your composer file and install the package:

Publish the configuration file

Run plugin migrations (we use the op_* prefix for our tables)

Upgrade

Run plugin migrations (we use the op_* prefix for our tables)

Configuration

  1. Go to your On Page and generate a new snapshot from the "Snapshot Generator" section
  2. Copy the Snapshot Generator API token
  3. Add the following to your .env file:

By default, the plugin will create a onpage-models directory in your base directory. The folder will be filled with On Page generated models, which you should not modify, as they are generated automatically. By default, the models will live in the Data namespace, so you can access them using \Data\ModelName::.... To make this work, you need to instruct composer to preload this folder.

Finally make sure to update composer.

Import data

To import your data execute this command:

Error prevention If some resources or fields have been removed or changed, the import will prompt you whether you want to continue or not. You can use the --force flag to ignore this warning.

Useless import prevention If you try to import same data you already have, the import is stopped. You can use the --anyway flag to ignore this warning.

Restore a previous snapshot

Each time you import data, the snapshot is saved locally in your Laravel project. If you want to restore a previous snapshot execute the rollback command and digit the number associated at the snapshot choosen.

Querying data

Because the plugin does not actually generate tables and columns corresponding for your data, you will have to use the whereField function instead of the where clause, which works in the same manner. If you have trouble doing some operations, please open an issue explaining your use case.

Advanced whereField clauses:

If you need to query data with advanced where* clauses, you have to use the advanced whereField* functions.

You can also combine them to obtain more advanced clauses, which work in the same manner.

Getting values

Once you get your records, you need to display the related data. To access field data for a record, you need to use the ->val($field_name, $lang) function. The $lang is set to use the current default language. Examples:

Multivalue fields

For fields which contain multiple values, the val function will always return a collection of the values:

File and image fields

For these files, the returned value will be an instance of \OnPage\File::class. To get a file or image url use the ->link() function. The link will point to the original file.

To turn images into a thumbnail add an array of options as shown below:

Getting Resources and Fields

`

Using Fields Folders

`


All versions of laravel-plugin with dependencies

PHP Build Version
Package Version
No informations.
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 onpage-dev/laravel-plugin contains the following files

Loading the files please wait ....