redooor/redminportal

RedminPortal by Redooor
A Laravel package as a backend administrating tool for Content Management and Ecommerce sites. Gives you ability to add, edit and remove category, product, promotions and many more. Provides User Interface for administrating users and groups.
RedminPortal currently supports Laravel 13. See Compatibility.
Table of Content
- Compatibility
- Breaking changes in v2
- Models and Features
- Installation guide for Users
- Showing pages on your own frontend
- Installation guide for Contributors
- Testing
- Versioning
- Contributing
- Creator
- License
- External Libraries Used
- Change log
- Upgrade Guide
Compatibility
| Laravel | RedminPortal | Branch | Status |
|---|---|---|---|
| 13.x | 2.x | v2 | Active |
| 5.8 | 0.58.x | v0.58 | Inactive |
| 5.1 | 0.3.x | v0.3 | Inactive |
| 5.0 | 0.2.x | v0.2 | Inactive |
| 4.2 | 0.1.x | v0.1 | Inactive |
The focus of the development will be on branch v2, which supports Laravel 13.
Development for branch v0.1, v0.2, v0.3, and v0.58 has stopped. Please upgrade to v2.
Upgrading
Refer to UPGRADE.md for upgrading instructions from any previous version.
Breaking changes in v2
Besides the move to Laravel 13 and PHP 8.3, these changes can affect an existing installation. Each one has a migration step in UPGRADE.md.
| Area | What changed | What you need to do | Step |
|---|---|---|---|
| Admin actions | The admin routes verify the CSRF token. Delete, remove image, activate/deactivate user, change order status, media duration and log out are now POST, not GET links. |
Custom views: add @csrf to forms, use data-method="post" or the confirm modal on links, send the token with Ajax calls. Old GET links return 404/405. |
12 |
| Uploads | Media uploads only accept the extensions in the new media config and are limited by media.max_size; file names are cleaned. Images are stored with an extension that matches their real type (jpg, png, gif). |
Add any other media types you need to media.allowed_extensions (publish the config). |
13 |
| Permissions | Activate/deactivate, remove image, media upload and duration, product variant edit need update (variant create needs create, variant delete needs delete) instead of view. Adding or deleting a purchase also needs the matching orders permission. Image removal only works through the owning module. | Give groups and users the update, create or delete permissions they now need. Explicit entries such as admin.users.deactivate.view become admin.users.deactivate.update. |
14 |
| Users and groups | You can only grant permissions you hold and assign groups you fully cover, and you cannot edit, activate, deactivate or delete an account (or group) that has more access than you. | Use an administrator with full access for these tasks. | 15 |
| Default administrator | The seeder no longer creates admin@admin.com with the password admin. It creates the administrator from REDMIN_ADMIN_EMAIL and REDMIN_ADMIN_PASSWORD, or prints a generated password once. It also no longer deletes existing users and groups. |
See Seeding the first administrator. Change the password of any account that still uses admin. |
15 |
| Sign-in and passwords | Sign-in is limited to 5 failed attempts per minute for each email and IP address. New passwords need at least 10 characters (password.min_length). Changing a password signs out that user's other sessions; changing your own password in My Account no longer signs you out. |
Update scripts or tests that use short passwords. | 15 |
| Descriptions and names | Category, product and translation descriptions are cleaned before they are shown: scripts, event attributes, styles and javascript: links are removed. Names and order-line labels are always escaped. |
If you stored HTML that relied on scripts, inline styles or iframes, it no longer shows them. Use the editor's plain formatting, images and links. | 16 |
| Report exports | Text cells that start with =, +, - or @ (or a tab or carriage return) are prefixed with ' so spreadsheets do not run them as formulas. |
Nothing, unless you post-process the exports and expect the raw value. | 16 |
| Tag API | /api/tag and /api/tag/name need a signed-in, active user. They were public. |
Sign in first, or serve your own public tag list if a front end called these URLs. | 16 |
| Images | Uploaded images are re-encoded (metadata such as GPS is removed, JPEG photos are auto-rotated, animated GIFs are kept as they are) and limited to image.max_pixels pixels. Images can have an order and a primary image (new images.sort_order and images.is_primary columns). Upload forms take several files (images[]) and the edit pages let you make an image primary or move it (new imgprimary and imgmove routes need the update permission). |
Run php artisan migrate and publish the public assets again (--tag=public --force). Check image.upload_quality and image.max_pixels (publish the config with --tag=config). Files stay public in assets/img and Image::path is unchanged. |
17 |
Models and Features
User Management
- User
- Group
- Mailinglist
Content Management
- Announcement
- Page
- Portfolio
- Post
- Promotion
Online Store (Physical Products)
- Bundle
- Category
- Coupon
- Order
- Product (now supports variations)
Membership Subscription (Digital Products)
- Bundle
- Category
- Coupon
- Media
- Membership
- Module
- ModuleMediaMembership
- Order
Purchase(deprecated, replaced by Order)- Pricelist
Morphs
- Image
- Revision (new! Now changes to Orders are tracked)
- Tag
- Translation
Traits
- Permissible
- Revisionable
Classes
- File
- Volume
- Weight
- Imagine
- Redminportal (use as alias in blade template)
Helpers
- RHelper
RImage(replaced by Classes/Imagine, retained for backward compatibility)
Facades
- Redminportal
Downloadable Reports
- Downloadable CSV reports for Purchases and Mailinglist.
Translation options
There is an translation option in Category, Module, Media, Product, Promotion and Portfolio.
You can add more languages in the translation config file at path
vendor\redooor\redminportal\src\config\translation.php
or if you have published it to your root
root\config\packages\redooor\redminportal\translation.php
To use it, get the model's translations and use json_decode to convert content into an object, like this:
foreach ($product->translations as $translation) {
$lang = $translation->lang;
$translated = json_decode($translation->content);
var_dump($translated->name, $translated->short_description, $translated->long_description);
}
Installation guide for Users
You can create a new Laravel 13 application using the command:
composer create-project laravel/laravel myproject
-
Add Redminportal to composer.json of a new Laravel application, under "require". Like this:
"require": { "laravel/framework": "^13.0", "redooor/redminportal": "^2.0" }, -
Then run
php composer update [--prefer-dist]in a terminal.Use
--prefer-distto include only essential files (i.e. exclude tests). -
Now, edit your [root]\config\app.php providers and alias array like this:
'providers' => array( Illuminate\Foundation\Providers\ArtisanServiceProvider::class, ... omitted ... // Add this line Redooor\Redminportal\RedminportalServiceProvider::class, ), -
Then run
php composer dump-autoloadin a terminal. -
Important: remove Laravel's default
usersmigration first.Redminportal creates its own
userstable (with extra columns such asfirst_name,last_name,permissionsandactivated). Its migration is skipped when auserstable already exists, so if Laravel's default one has been migrated, the later seeding step fails withtable users has no column named first_name.In a new Laravel application, delete
database/migrations/0001_01_01_000000_create_users_table.phpbefore running any migration. If you have already migrated, delete the file and runphp artisan migrate:fresh(this drops all tables).That default migration also creates the
sessionstable. If you keepSESSION_DRIVER=database, add thesessionstable back yourself, or setSESSION_DRIVER=filein your.env.If your application already has its own
userstable, Redminportal will not alter it. You must add the missing columns yourself, or use a separate database for Redminportal.Then run the following commands in a terminal to perform database migration for Redminportal:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="migrations" [--force] php artisan migrate --path=/database/migrations/vendor/redooor/redminportalCAUTION: using --force will overwrite existing files
-
Run the following in a terminal to seed the database with the first administrator (see Seeding the first administrator):
REDMIN_ADMIN_EMAIL=you@example.com REDMIN_ADMIN_PASSWORD='choose-a-long-password' php artisan db:seed --class="Database\Seeders\RedminSeeder"If you leave out
REDMIN_ADMIN_PASSWORD, a random password is generated and printed once. Copy it from the terminal output. -
Publish package assets by running this in a terminal:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="public" [--force]CAUTION: using --force will overwrite existing files
-
Publish package config by running this in a terminal:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="config" [--force]CAUTION: using --force will overwrite existing files
IMPORTANT:
The package will append neccesary guards and providers to your
authconfig. If you've added a guard with the same name asredminguardand provider asredminprovider, they'll be replaced by the package's setting.If you're going to use your own
authconfig but would like to use Redminportal for authentication, you need to add the a guard in yourauthconfig as below:'defaults' => [ 'guard' => 'web', // or it could be 'redminguard' 'passwords' => 'redminpasswords', ],'guards' => [ 'redminguard' => [ 'driver' => 'session', 'provider' => 'redminprovider', ], 'web' => [ 'driver' => 'session', 'provider' => 'redminprovider', ], ],'providers' => [ 'redminprovider' => [ 'driver' => 'eloquent', 'model' => Redooor\Redminportal\App\Models\User::class, ], ],'passwords' => [ 'redminpasswords' => [ 'provider' => 'redminprovider', 'table' => 'password_reset_tokens', 'expire' => 60, ], ], -
Optional: Publish package views by running this in a terminal:
Only do this if you want to modify Redminportal views without editing the source code.
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="views" [--force]CAUTION: using --force will overwrite existing files
Seeding the first administrator
Database\Seeders\RedminSeeder creates the Admin and User groups and one active administrator. It does nothing when the users table already has records, and it never deletes users or groups.
| Variable | Meaning |
|---|---|
REDMIN_ADMIN_EMAIL |
Email of the administrator. Defaults to admin@example.com. |
REDMIN_ADMIN_PASSWORD |
Password of the administrator (at least 10 characters, otherwise the seeder stops without creating anything). When it is not set, a random 20-character password is generated and printed once in the terminal. It is not stored or logged anywhere else. |
For local development and demos only, Database\Seeders\RedminDemoSeeder creates admin@admin.com with the password admin. It only runs when APP_ENV is local, development or testing (a missing APP_ENV counts as production). If a site was seeded with the old seeder, change the password of admin@admin.com (or deactivate that account) after signing in.
Showing pages on your own frontend
RedminPortal is an admin dashboard only. It stores your content, and your Laravel application decides how to show it. This example shows pages created in Admin > Pages at the site root, so a page with slug about appears at /about (not /page/about).
If you would rather not build this yourself, the optional RedminStore package does exactly this out of the box.
-
In the admin, create a page: set a Title, Content and Slug (for example
about), and leave Private unchecked. Private pages should never be shown publicly. -
Create a controller,
app/Http/Controllers/PageController.php:<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Redooor\Redminportal\App\Models\Page; class PageController extends Controller { public function show(Request $request) { $slug = trim($request->path(), '/'); // Only single-segment URLs such as /about; anything else is a normal 404. abort_if(str_contains($slug, '/'), 404); $page = Page::where('slug', $slug) ->where('private', false) // never show pages marked Private in the admin ->firstOrFail(); return view('page', ['page' => $page]); } } -
Create the view,
resources/views/page.blade.php. Use your own layout here:<h1>{{ $page->title }}</h1> {{-- Page content is HTML written by trusted admins in RedminPortal's editor. --}} {!! $page->content !!} -
Register a fallback route at the end of
routes/web.php:use App\Http\Controllers\PageController; Route::fallback([PageController::class, 'show']);
A fallback route runs only when no other route matches, so it never takes over your own routes or RedminPortal's /admin and /login, whatever order they are registered in. A page with the same slug as a real route (for example login) is therefore never shown. Unknown URLs return your normal 404 page. Use a controller rather than a closure so that php artisan route:cache keeps working.
Notes:
- Slugs are stored with spaces replaced by underscores. Use letters, numbers,
-and_in slugs. $page->contentis raw HTML, so only print it unescaped ({!! !!}) if only trusted admins can edit pages.- A page also has
category,tags,imagesandtranslationsrelationships, for example$page->imagesand$page->tags. - Posts work the same way: use the
Postmodel withwhere('private', false), and give them a prefix such as/blog/{slug}to avoid clashing with page slugs.
Installation guide for Contributors
It is recommended that contributors use Laravel Homestead for development because it will provide the same development environment for all of us. Read more about Laravel Homestead here.
For Mac users, you may want to try out Laravel Herd.
- Install Laravel 13 using this guide. We'll call this the [root].
You can create a new Laravel 13 application using the command:
composer create-project laravel/laravel myproject
-
Create a folder named "packages" inside the [root] folder.
-
Clone the Redooor\Redminportal repository into [root]\packages\redooor\redminportal folder.
-
Open a terminal, cd to [root]\packages\redooor\redminportal folder then run:
composer update --prefer-dist -vvv --profile -
Then add Redooor\Redminportal source to [root]'s composer.json under "autoload" like this:
"autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/", "Redooor\\Redminportal\\": "packages/redooor/redminportal/src" } }, -
Then cd to [root]'s folder and run:
composer update --prefer-dist -vvv --profile --no-devNOTE: the [root]'s phpunit dependency will clash with the package's phpunit. "
--no-dev" ensures that it is not installed on [root]. You can also choose to remove phpunit fromrequireinside the [root]'s composer.json. -
Now, edit your [root]\config\app.php providers and alias array like this:
'providers' => array( Illuminate\Foundation\Providers\ArtisanServiceProvider::class, ... omitted ... // Add this line Redooor\Redminportal\RedminportalServiceProvider::class, ), -
Run the following commands in a terminal to perform database migration for Redminportal inside the [root] folder:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="migrations" [--force] php artisan migrate --path=/database/migrations/vendor/redooor/redminportalCAUTION: using --force will overwrite existing files
-
Run the following in a terminal to seed the database with a demo administrator for local development (never use this on a shared or production site; it only runs when
APP_ENVislocal,developmentortesting):php artisan db:seed --class="Database\Seeders\RedminDemoSeeder" Username/password: admin@admin.com/admin -
Publish package assets by running this in a terminal:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="public" [--force]CAUTION: using --force will overwrite existing files
-
Publish package config by running this in a terminal:
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="config" [--force]CAUTION: using --force will overwrite existing files
-
Optional: Publish package views by running this in a terminal:
Only do this if you want to modify Redminportal views without editing the source code.
php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="views" [--force]CAUTION: using --force will overwrite existing files
Build assets
-
Install Node.js 22.12 or later.
-
cd to packages/redooor/redminportal
-
Run
npm cito install the build dependencies. -
Run
npm run buildto compile the Sass insrc/resources/assets/scssand copy the vendored assets intosrc/public. -
From your Laravel application's root folder (where
artisanlives), publish the assets with:php artisan vendor:publish --provider="Redooor\Redminportal\RedminportalServiceProvider" --tag="public" --force
Testing
-
In packages\redooor\redminportal folder, run
composer update --prefer-dist -vvv --profile vendor/bin/phpunitNOTE: If you run out of memory while running the full tests, try running the tests by sub-folders.
vendor/bin/phpunit tests/models/ vendor/bin/phpunit tests/controllers/ vendor/bin/phpunit tests/relationships/ ./vendor/bin/phpunit --testsuite "suite1","suite2" ./vendor/bin/phpunit --testsuite "suite3","suite4"
Versioning
For transparency into our release cycle and in striving to maintain backward compatibility, Redooor RedminPortal will adhere to the Semantic Versioning guidelines whenever possible.
Contributing
Thank you for considering contributing to RedminPortal. Before any submission, please spend some time reading through the CONTRIBUTING.md document.
Creator
Andrews Ang
License
RedminPortal is open-sourced software licensed under the MIT license.
External Libraries Used
- Bootstrap 5.3 with the Redmaterials theme
- Font Awesome Free 7
- jQuery 3.7 and jQuery UI 1.14
- Jodit 4 (rich text editor)
- Tempus Dominus 6 and Popper (coupon date picker)
- typeahead.js and bootstrap-tagsinput (tags)
- illuminate/html
- maatwebsite/excel
- Imagine
- Plupload
- getID3
Change log
Refer to CHANGELOG.md
Upgrade Guide
Refer to UPGRADE.md
Related Packages
Cloud native, API first Laravel eCommerce package with integrated AI for ultra-f...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v0.58.0 | >=7.1.3 | 5.8.* | MIT | |
| v0.3.3.1 | >=5.5.9 | 5.1.* | MIT | |
| v0.3.3 | >=5.5.9 | 5.1.* | MIT | |
| v0.3.2 | >=5.5.9 | 5.1.* | MIT | |
| v0.3.1 | >=5.5.9 | 5.1.* | MIT | |
| v0.3.0 | >=5.5.9 | 5.1.* | MIT | |
| v0.2.3.1 | >=5.4.0 | 5.0.* | MIT | |
| v0.2.3 | >=5.4.0 | 5.0.* | MIT | |
| v0.2.2 | >=5.4.0 | 5.0.* | MIT | |
| v0.2.1 | >=5.4.0 | 5.0.* | MIT | |
| v0.2.0 | >=5.4.0 | 5.0.* | MIT | |
| v0.1.6 | >=5.3.0 | MIT | ||
| v0.1.5 | >=5.3.0 | MIT | ||
| v0.1.4 | >=5.3.0 | MIT | ||
| v0.1.3 | >=5.3.0 | MIT | ||
| v0.1.2 | >=5.3.0 | MIT | ||
| v0.1.1 | >=5.3.0 | MIT | ||
| v0.1.0 | >=5.3.0 | MIT |