teelevision/redaxo5-laravel is a Laravel package for the laravel framework as redaxo5 addon..
It currently has 5 GitHub stars and 5 downloads on Packagist (latest version v5.5.28).
Install it with composer require teelevision/redaxo5-laravel.
Discover more Laravel packages by teelevision
or browse all Laravel packages to compare alternatives.
Last updated
teelevision/redaxo5-laravel is a port of the Laravel framework that runs as an add-on in Redaxo5. It aims at enabling you to write Redaxo5 add-ons the way you would write a Laravel application.
This documentation only covers the differences to the Laravel documentation. Any topic not mentioned below should in theory work as described in the Laravel documentation. In practice many features are yet untested.
In addition to the Server Requirements you will need a running instance of Redaxo version 5.0 or greater.
Inside your Redaxo installation go to /redaxo/src/addons and run the following to install:
composer create-project teelevision/redaxo5-laravel my_laravel_addon "5.7.*"
You do not need to configure your web server. I mean, there is no way to, you have to get a web server running Redaxo, not the add-on. You can use pretty URLs in the frontend using YRewrite, I suppose. In the backend pretty URLs are not be supported.
You should still configure your .env file, especially creating an application key.
Like every other add-on you have to install it in the Redaxo backend in order to use it.
Make sure that the root directory of your add-on is writable, as well as the storage directory, its sub-directories, and the bootstrap/cache directory.
assets directory is the Redaxo add-on assets directory. Any files placed here are copied to a public directory when installing the add-on.config directory does not contain the cache directory which instead is moved to Redaxo's cache.lib directory is used by add-ons to provide code that Redaxo scans and auto-loads. So this is directory needs to be used for classes and functions that should be available in the frontend (Redaxo modules) or to other add-ons.pages directory
pages/index.php and pages/frontend.php instead of public/index.php. But those files do not really qualify as entry points. They are more like the interface between the add-on and Redaxo or other add-ons. Redaxo calls pages/index.php automatically for any backend add-on page.public directory does not exist. The functionality lies within the assets and pages directories.storage directory
vendor directory is renamed vendor-composer because otherwise Redaxo tries to index all the files in there which could take minutes.package.yml file describes your add-on and is required by Redaxo.app/Redaxo directory contains models for redaxo database tables like users. This does not yet contain all models and each model could be incomplete.page query parameter instead of the path of the uri. For example the route my_laravel_addon/welcome matches page=my_laravel_addon/welcome which is how Redaxo knows where to route a request in the backend. This requires you to begin your route's uri with the name of your add-on. However you can define frontend routes that do not have this limitation. Frontend routes can be called using MyLaravelAddOn::frontend('route_uri') from Redaxo modules in the frontend or basically from everywhere outside your add-on.package.yml so that Redaxo knows that it should call your add-on.package.yml which does not support it. The query parameters except page are used as route parameters instead for callback/controller arguments. This is untested if there are multiple parameters since the order might not be defined which would lead to problems. So only use one parameter to be sure. Also there is no equivalent for a required parameter, which requires you to check each argument yourself. It could be possible to write a route validator using the route's wheres to achieve this.MyLaravelAddOn::frontend($uri). Otherwise null is returned.action() and route() helpers for backend routes only. This is because for frontend routes it is not generally possible to tell from which single url a frontend route will be called. Frontend routes can be called from anywhere outside your add-on.url() helper to generate urls, instead use the rex_url class and rex_getUrl function provided by Redaxo.page query parameter which is used by Redaxo in the backend for routing requests. Therefore you have to explicitly change the pagination page parameter like for example: ->paginate(15, ['*'], 'p').Redaxo provides very little for add-ons compared to the huge frameworks like Laravel. While this works for small add-ons it hardly satisfies my developer needs when creating something bigger. During one project I saw myself using more and more of the illuminate/* packages that I love so much, that I decided to try booting the whole framework. I don't want to take a stand on whether this is a good idea, I just want to share this solution that helped me finish that one project.
The Laravel framework is licensed as stated on their page.
All changes to the Laravel framework in this repository are open-sourced software licensed under the MIT license.