Download the PHP package stats4sd/laravel-shiny-loader without Composer
On this page you can find all versions of the php package stats4sd/laravel-shiny-loader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stats4sd/laravel-shiny-loader
More information about stats4sd/laravel-shiny-loader
Files in stats4sd/laravel-shiny-loader
Package laravel-shiny-loader
Short Description This is my package laravel-shiny-loader
License MIT
Homepage https://github.com/stats4sd/laravel-shiny-loader
Informations about the package laravel-shiny-loader
Laravel Shiny Loader
A Laravel package that lets you embed Shiny apps into your Laravel application with iFrames.
...But surely that doesn't need a package? You're right - you can just use an iFrame and point it at your Shiny app (as long as the app is publicly accessible).
This package does more than that - it provides a way for Laravel to communicate with the Shiny app to:
- pass initialisation data into the app
- ensure that the current user is authenticated before loading the app.
How does it work?
TODO: Update and bring over documentation from : https://github.com/stats4sd/shiny-laravel-auth-example
Requirements: one shiny server per Laravel app
All shiny apps embedded in one Laravel app must be served by a single shiny server instance, from a single root url. Each app is served at {root_url}/{app-name}/, and the auth handshake relies on a .sessions directory at the shiny server's root, shared between all apps and readable by Laravel (same machine or a shared/mounted volume).
This means the app names are part of your application's structure: they must match the app's folder name on the shiny server in every environment, and your blade views reference them directly. They therefore live in the committed config file, not in .env. Only the root url and root path vary per environment.
Running apps individually with shiny::runApp() on ad-hoc ports is not supported — there is no shared root url in that mode. For local development, either run a shiny server (e.g. via Docker) serving all apps, or use the R package's OVERRIDE_LARAVEL_AUTH=true bypass (see stats4sd/shiny-laravel-auth).
Installation
You can install the package via composer, then publish the config file:
Add the following properties to your .env file:
Then register each embedded app's name in config/shiny-loader.php (names are folder names on the shiny server):
Use
To enable authentication, register the auth route in your routes/web.php (wrap it in whatever auth middleware suits your app):
Embed an app with the ShinyIframe component, passing the app's name (it must be listed in shiny-loader.apps). You may optionally add $postData — an array of data to pass to the Shiny app when it loads:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Dave Mills
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-shiny-loader with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0