Download the PHP package rjvandoesburg/laravel-nova-url-rewrite-templating without Composer

On this page you can find all versions of the php package rjvandoesburg/laravel-nova-url-rewrite-templating. 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-nova-url-rewrite-templating

Combining URL rewrites with dynamic JS templating for your Laravel Nova powered application

This packages is build on top of two other packages:

I was building a Laravel Nova application but was missing the front-end ease-of-use in combination with Nova. Ruthger Idema had built a url rewrite package which he was using with Nova, but was using Laravel for the routing. I was also using Nova but was using Vue.js for my front-end so I wanted pretty urls and to just build my front-end via an API.

Because people might want just one or the other I made 3 packages (templating, url rewrite and one that combines the other two)

What this package allows you to do is use Nova for your resources, add url rewrites so urls are nice and pretty and call an endpoint from your JS application and you will receive a list of potential templates to load.

Requirements

This package requires Laravel 5.8 or higher, PHP 7.2 or higher.

Installation

You can install the package via composer:

The package will automatically register itself.

Routing

Instead of using the route provided in Laravel Nova templating you need to add the following to your routes file (preferably api.php)

Which will add the following routes:

If the resource route returns a 404 it will try the other url as well.

Laravel Nova Url Rewrite comes with a migration, config and translations, please have a look if you wish to publish any of these files.

Usage

Much like the usage of Laravel Nova templating new endpoints will be available and return a list of names you can use for templating. However a 'cach-all' route is added with this package which will look for a url rewrite to decide what to return.

A typical response could be:

However if it is just a route without a resource and or model, the response is quite small:

(This needs work, e.g. a name could be generated based on the Request path and Target path)

In this case I would advise using a Page resource which will allow you to define the look and feel for a page.

Redirects

When a url rewrite is a redirect the response is a little bit different as no templates are returned:

The redirect path is returned as with the status (allthough chances are you cannot return a server response) and if the redirect is to an external url.

VueJs

Say you want to use this within Vue, here is an example of how you could implement this:

From app.js I am loading all files within the templates folder and prefixing template as the name when registring them with Vue.

Create a Vue file that will be rendered on specific routes. In the example I am using vue-router and beforeRouteEnter to retrieve the correct template based on the current url.

TODO

Contributing

Please see CONTRIBUTING for details.

Credits

Special thanks for Spatie for their guidelines and their packages as an inspiration

License

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


All versions of laravel-nova-url-rewrite-templating with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
laravel/framework Version ~5.8||^6.0
laravel/nova Version *
rjvandoesburg/laravel-nova-url-rewrite Version ^1.0
rjvandoesburg/laravel-nova-templating Version ^1.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 rjvandoesburg/laravel-nova-url-rewrite-templating contains the following files

Loading the files please wait ....