Download the PHP package lupennat/nova-better-lens without Composer

On this page you can find all versions of the php package lupennat/nova-better-lens. 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 nova-better-lens

  1. Requirements
  2. Installation
  3. Usage
  4. Trait Improvements
    1. Authorization
    2. Hide From Toolbar
    3. With Related
    4. Per Page
    5. Decorate Collection
    6. Resource Link Parameters
    7. Create Link Parameters
    8. Breadcrumbs
  5. Many Fields
  6. Lens Field

Requirements

Installation

NOVA PACKAGE
<4.29.5 1.x
>4.29.6 2.x

Usage

Laravel Nova Better Lens, improve Nova Lenses Behaviours

Include trait on Lens.

Trait Improvements

Authorization

Better Lens provide the ability to define authorization for lens. You can override parent resource methods using standard laravel authorization methods.

Authorize To Create

By Default Nova Lens does not provide the ability to Create/Attach resource, to mantain compatibility authorizedToCreate will work only if lens will be loaded with many* Fields or if the method is explicitly defined in the lens.

Hide From Toolbar

Better Lens provide the ability to exclude a lens from parent resource toolbar list by the static method hideFromToolbar (by default is false).

With Related

Better Lens provide the ability to make lens Viewable only as related resource.\ By default all lens on Nova can be linked on Menu and can be loaded as a standalone index resource. With static method withRelated, you can override default behaviour and prevent lens to be loaded without a viaResource request (by default is empty array).

Per Page

Better Lens provide the ability to define perPage options for lens. Using static methods perPageViaRelationship and perPageOptions you can override parent resource perPage options (by default use parent resource options).

you can also choose to show pagination filter when lens are loaded as relation via static showPaginationViaRelationship method (by default is false).

Decorate Collection

Better Lens provide the ability to manipulate the collection of models returned by the query, you can override the static method decorateCollection and change the collection before it will be used to serialization (by default it return the original collection).

Returned Collection should always return a Collection of Eloquent models, returning other types can generate runtime errors.

Resource Link Parameters

Better Lens provide the ability to define extra parameters for view and edit url. You can define a list of parameter => value using static method resourceLinkParameters (by Default is empty array).

Create Link Parameters

Better Lens provide the ability to define extra parameters for creation url. You can define a list of parameter => value using static method createLinkParameters (by Default is empty array).

Breadcrumbs

Better Lens provide the ability to override default Breadcrumbs for Lens pages using method breadcrumbs (by Default Nova Lens page breadcrumbs are loaded).

Many Fields

Better Lens automatically enable a new method lens for all Many Relationship Fields:

many relationship will load the lens view instead of the main resource.

Lens Field

Better Lens provide a new field Lens that can be used to load a resource lens without a "real many relationship".\ By the field Lens it is possible to create a related table without creating a Custom ResourceTool.

Example

We want to load a table with all translation key and the related translation value for current website. The table translation_keys does not have a real relation with the website resource and only contains all the translation keys. The table translations instead contains both the relation with key and website.\ We don't want to use directly the translations table because we will lost the key not translated for the current website, we need to start from translation_keys table and load the website value from the translations table if present.


All versions of nova-better-lens with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
laravel/nova Version >4.29.5
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 lupennat/nova-better-lens contains the following files

Loading the files please wait ....