Download the PHP package inventor96/inertia-mako without Composer

On this page you can find all versions of the php package inventor96/inertia-mako. 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 inertia-mako

Inertia.js Mako Adapter

An Inertia.js server-side adapter for the PHP Mako framework.

Installation

  1. Install the composer and npm packages:

    Yes, the laravel vite plugin is intentional. We could create our own, but that would pretty much be reinventing the wheel. Note that when running npm run dev later, the Laravel plugin will report the APP_URL as undefined, but that's OK for our situation.

  2. Set other npm configs: package.json:

  3. Create the vite config: vite.config.js:

  4. Create the JS app file: app/resources/js/app.js:

  5. Enable the package in Mako:
    app/config/application.php:

  6. Register the middleware: app/http/routing/middleware.php:

Configuration

If you would like to override the default configuration, create a new file at app/config/packages/inertia/inertia.php.

The following configuration items and their defaults are as follows:

For vite-specific configurations, create a vite.php config file in the same directory.

Using a Custom html_template

You will probably want to create your own html_template at some point in your project. There are 3 values passed to the template from the InertiaRenderer. You can add to these using built-in Mako functionality.

Here is the default page used in this inertia-mako package:

Coding Your App

The idea of this InertiaJS adapter is to utilize existing Mako framework functionality. As such, it's built to have the Vue files be organized under app/resources/views/. Pages should be under the Pages/ folder. For example:

In your routes or controllers, you can use the Mako ViewFactory::render() method to handle the InertiaJS response, prefixing the path with Pages/. e.g. $view->render('Pages/Welcome').

The Inertia class is registered in the Mako dependency injection container under the inertia key. So as an alternative to using the ViewFactory with the path prefix, you call $this->inertia->render('Welcome'). This is just a wrapper around the original method, so there's really no difference under the hood. It's just there for personal preference sake.

Asset Versioning

Inertia.js features asset versioning to mitigate stale client-side caching. To indicate the server-side version, create a file at app/config/packages/inertia/version.php that functions like the following:

You can make that file do whatever you need to come up with your verison. The only requirement is that it ultimately returns an array with a single string value.


All versions of inertia-mako with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0|~8.2.0|~8.3.0
ext-json Version *
mako/framework Version ^10.0
mindplay/php-vite 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 inventor96/inertia-mako contains the following files

Loading the files please wait ....