Download the PHP package tightenco/laravel-elm without Composer

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

Laravel Elm logo


Latest Version on Packagist

A Platform for Elm on Laravel

Tired of the paradox of choice and constant churn on the frontend?

Want a stable and opinionated platform to build on?

This package makes it seamless.

Requirements

Docs

Some Elm knowledge required from here on!

Elm learning resources

Installation

Optional Auth Scaffolding (Tailwind)

Note: Don't forget to run php artisan migrate!

Watch your elm files just like you would everything else

Note: Elm compilation will be drastically faster than you are used to 🔥

And open your local site! (valet link && valet open) Try going to /login or /register!

General assets note!

You can add public/js and public/css to your .gitignore if you wish to avoid committing these built files!

Creating a page

this creates resources/elm/Example/Welcome.elm

Now use the Elm facade to render your Elm Page!

routes/web.php

Hello, Example!

Some Elm knowledge required from here on

Learning resources

Pass values to your page

Update your Laravel route:

routes/web.php

Update your Elm page:

resources/elm/pages/Welcome.elm

Share values with all your pages

AppServiceProvider.php

Routing

Routing in Laravel Elm is handled completely by your Laravel routes!

However, we can use those routes in our Elm code in a built in way.

  1. Add a route, for example, our Welcome page, with a name:

  2. Run the elm:routes command to generate the Elm routes file

    resources/elm/laravel-elm-stuff/Routes.elm (don't edit this manually)

  3. Now we can send users to this page from Elm in our update handlers:

    Send the user to /

Or even post some data to an endpoint:

POST /todos with the "description" of "add more docs"

Validation errors

The errors value is automatically passed to your Elm views, all you need to do is add it to your props to use it!

Interop with Javascript

Talk back and forth from JS & Elm resources/elm/ExamplePage.elm

Debugging

Laravel errors

Laravel errors are displayed in a modal on the frontend during development, using the same ignition error page that you are used to!

DevTools

Coming soon!

Persistent scroll

Sometimes you want an "app like" preservation of scroll positions while navigating to and from different pages.

Laravel Elm has built in support for this, by saving the viewport values into the history.

To use it you need to:

Progress indicators

In Elm

The loading prop is automatically passed to all your Elm views, you only need to add it to your props to use it!

In Javascript

You can access the loading state in javascript via the elm-loading event

Example using nprogress to show a top progress bar:

(after 180ms, so it does not appear for fast connections)

Deploying

Updating assets

Laravel Elm uses a service worker to ensure the latest assets are used in production. Add the php artisan elm:sw to your "prod" command to ensure it gets the latest versions of you assets.

Configuration

Hot reloading

You may want to disable hot reloading & debugging in development if your app is extremely large / complex

This disables the generation of debug code & does not start the hot reload server during npm run watch

Testing

Laravel tests

All your normal http tests function identically to how they do in a vanilla Laravel app.

But if we want to assert against the props that are sent to Elm, we can add the X-Laravel-Elm header to our tests/TestCase.php setUp method:

Now we can test everything via normal Laravel json assertion methods!

Example apps

Contributing

To get started contributing to Laravel Elm, check out the contribution guide.

Credits

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

View the license for this repo.


All versions of laravel-elm with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^8.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 tightenco/laravel-elm contains the following files

Loading the files please wait ....