Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Source Laravel Package

redaxo/source

REDAXO is a PHP-based CMS/website framework focused on flexible, module-driven content creation with full control over input/output. Multilingual, highly extendable, and workflow-friendly, with strong community resources, docs, and addons.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    git clone https://github.com/redaxo/core redaxo && cd redaxo
    composer install
    

    Use Docker for local dev:

    docker-compose up -d
    

    Access the installer at http://localhost/redaxo/install/.

  2. First Use Case:

    • Install the demo_base addon via the Addon Manager (fully English-translated demo).
    • Navigate to Content > Pages to create a basic page structure.
  3. Key Directories:

    • redaxo/src/core/ – Core classes (e.g., rex_*, rex_sql_table).
    • redaxo/src/addons/ – Bundled addons (e.g., mediapool, structure).
    • redaxo/var/ – Runtime data (cache, logs, backups).
  4. Quick Start:

    • Extend the core by creating a custom addon in redaxo/src/addons/your_addon/.
    • Use the YAML config (config.yml) for environment variables (e.g., !env DB_PASSWORD).

Implementation Patterns

Core Workflows

  1. Database Interactions:

    • Use rex_sql_table for table definitions (supports migrations via rex_sql).
    • Example:
      class MyTable extends rex_sql_table {
          public function getTableStructure() {
              return [
                  'id' => ['type' => 'int', 'autoinc' => true],
                  'title' => ['type' => 'varchar', 'length' => 255],
              ];
          }
      }
      
  2. Content Management:

    • Pages/Slices: Leverage the structure addon for nested content.
      $slice = rex_slice::getCurrent();
      $slice->setValue('title', 'My Content');
      $slice->save();
      
    • Media Handling: Use rex_media for file uploads and MIME checks.
      $media = rex_media::get($filePath);
      $mime = $media->getMimeType(); // Supports `csv`, `html`, `json`, etc.
      
  3. Event System:

    • Hook into events (e.g., MEDIA_LIST_QUERY) via rex_extension_point.
      rex_extension_point::register('MEDIA_LIST_QUERY', function($params) {
          $params['query']->where('type', 'image');
          return $params;
      });
      
  4. CLI Automation:

    • Use Symfony Console commands (e.g., user:list).
      php redaxo/cli.php user:list
      
  5. Frontend Integration:

    • Render content with templates (rex_template).
      $template = rex_template::get('my_template');
      $template->setVar('content', $myData);
      $template->parse();
      

Integration Tips

  • Addon Development:
  • Multilingual Support:
    • Localize strings with rex_i18n:
      rex_i18n::setLanguage('en');
      echo rex_i18n::msg('my_addon', 'greeting');
      
  • Security:
    • Escape output with rex_escape:
      echo rex_escape($userInput);
      
    • Use rex_auth for role-based access:
      if (rex_auth::isUserInRole('editor')) { ... }
      

Gotchas and Tips

Pitfalls

  1. PHP 8.3+ Requirement:

    • Deprecated features (e.g., rex_editor in PHP 8.5) may trigger warnings. Update dependencies or patch core classes.
    • Example fix for rex_editor:
      if (version_compare(PHP_VERSION, '8.5.0') >= 0) {
          // Use alternative editor or suppress deprecations
      }
      
  2. Database Compatibility:

    • rex_sql_table normalizes TEXT defaults for MariaDB/MySQL. Test migrations in both environments.
    • Use Pdo\Mysql for PHP 8.5+ compatibility:
      $db = rex_sql::factory('Pdo\Mysql');
      
  3. Event System Quirks:

    • MEDIA_LIST_QUERY: Triggered for both list and count queries in paginated results (since v5.21.0).
    • SLICE_BE_PREVIEW: Passes the slice revision as a parameter:
      rex_extension_point::register('SLICE_BE_PREVIEW', function($slice, $revision) { ... });
      
  4. Session Handling:

    • Session timeout overlay may appear prematurely. Extend the session with:
      rex_session::extendSession();
      
  5. Addon Updates:

    • Deleting plugins during updates can cause silent failures. Verify plugin compatibility post-update.

Debugging Tips

  1. Error Handling:

    • Enable Whoops for detailed errors:
      rex_error::setHandler(new \Whoops\Run());
      
    • Check redaxo/var/log/ for runtime logs.
  2. SQL Debugging:

    • Log queries with:
      rex_sql::setDebug(true);
      
  3. Extension Points:

    • List all registered events:
      php redaxo/cli.php rex:extension_points:list
      
  4. Performance:

    • Cache frequent rex_sql queries:
      $cache = rex_cache::factory('my_cache_key', 3600);
      if (!$cache->isValid()) {
          $data = rex_sql::factory()->getAll(...);
          $cache->set($data);
      }
      

Extension Points

  1. Customize Media MIME Types:

    • Extend rex_file::getMimeType() by overriding the mediapool addon’s allowed types:
      rex_extension_point::register('MEDIA_ALLOWED_TYPES', function($types) {
          $types[] = 'webp';
          return $types;
      });
      
  2. Modify Backup Behavior:

    • Hook into BACKUP_PRE to add custom files:
      rex_extension_point::register('BACKUP_PRE', function($backup) {
          $backup->addFile('custom/path/file.sql');
      });
      
  3. Override Templates:

    • Replace default templates by copying them to redaxo/var/templates/ and modifying.
  4. Console Commands:

    • Add custom commands in redaxo/src/addons/your_addon/cli/:
      namespace YourAddon\Cli;
      use Symfony\Component\Console\Command\Command;
      use Symfony\Component\Console\Input\InputInterface;
      use Symfony\Component\Console\Output\OutputInterface;
      
      class MyCommand extends Command {
          protected function execute(InputInterface $input, OutputInterface $output) {
              $output->writeln('Hello from REDAXO!');
          }
      }
      
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope