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

Laranit Laravel Package

colbeh/laranit

Laravel package for interacting with the Laranit service from your app, providing basic integration helpers and configuration to connect, send requests, and handle responses. Suitable for projects needing a simple bridge between Laravel and Laranit APIs.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation

    composer require colbeh/laranit
    

    Publish the package config (if needed):

    php artisan vendor:publish --provider="Colbeh\Laranit\LaranitServiceProvider"
    
  2. First Use Case Initialize Laravel with default configurations (e.g., .env, config/app.php, and basic project structure) via:

    php artisan laranit:init
    
    • Run this in an empty directory (e.g., mkdir my-project && cd my-project).
    • Follow prompts to customize (e.g., app name, time zone, locale, database defaults).
  3. Where to Look First

    • Config: config/laranit.php (if published) for customization.
    • Commands: php artisan to list laranit: commands.
    • Documentation: Check the GitHub README for CLI flags/options.

Implementation Patterns

Workflows

  1. Bootstrapping a New Project

    • Use laranit:init to scaffold a Laravel project with pre-configured settings (e.g., auth scaffolding, queues, caching).
    • Example:
      php artisan laranit:init --with-auth --with-queue
      
  2. Customizing Initialization

    • Override defaults via .laranit.json (if supported) or environment variables:
      {
        "timezone": "America/New_York",
        "locale": "en_US",
        "database": {
          "driver": "mysql",
          "host": "127.0.0.1"
        }
      }
      
    • Pass flags directly:
      php artisan laranit:init --timezone="Asia/Kolkata" --locale="hi_IN"
      
  3. Integration with CI/CD

    • Use in deployment pipelines to ensure consistent Laravel environments:
      # Example GitHub Actions step
      - name: Initialize Laravel
        run: php artisan laranit:init --env=production --force
      
  4. Extending Functionality

    • Create custom initialization steps by publishing and extending the package’s service provider:
      // app/Providers/LaranitCustomizer.php
      use Colbeh\Laranit\Events\InitializationFinished;
      
      class LaranitCustomizer extends ServiceProvider {
          public function boot() {
              InitializationFinished::listen(function () {
                  // Add post-init logic (e.g., install Composer packages)
                  shell_exec('composer require spatie/laravel-permission');
              });
          }
      }
      

Gotchas and Tips

Pitfalls

  1. Overwriting Existing Files

    • laranit:init will overwrite files in the target directory. Use --force cautiously or back up existing files first.
    • Tip: Run ls -la before initialization to check for critical files.
  2. Environment Variable Conflicts

    • If .env exists, the package may skip or merge settings. Use --env flag to force overwrite:
      php artisan laranit:init --env=staging
      
  3. Database Configuration

    • Default database settings (e.g., DB_DATABASE) may not match your local setup. Verify config/database.php after initialization.
  4. Dependency Conflicts

    • The package may pull in specific Laravel versions. Check composer.json for conflicts:
      composer why-not laravel/framework 10.*
      

Debugging

  1. Verbose Output Enable debug mode for detailed logs:

    php artisan laranit:init --verbose
    
  2. Dry Run Test initialization without changes (if supported):

    php artisan laranit:init --dry-run
    
  3. Event Listeners Debug initialization events by listening to Colbeh\Laranit\Events\* in EventServiceProvider:

    protected $listen = [
        InitializationStarted::class => [
            \App\Listeners\LogInitStart::class,
        ],
    ];
    

Tips

  1. Template Customization

    • Override default templates (e.g., resources/views/auth/) by copying them to your project before running laranit:init.
  2. Post-Initialization Tasks

    • Chain commands for efficiency:
      php artisan laranit:init && composer install && php artisan key:generate
      
  3. Git Ignore

    • Add .laranit.json or laranit-* files to .gitignore if they’re auto-generated and not needed in version control.
  4. Local Development

    • Use --with-docker (if supported) to auto-generate docker-compose.yml for local setups:
      php artisan laranit:init --with-docker
      
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