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

Am I Up To Date Sf Laravel Package

acti/am_i_up_to_date_sf

Symfony-focused helper to check whether your project’s dependencies are up to date. Adds a simple command/utility for scanning installed packages and reporting available updates, making it easier to spot outdated components during development or CI.

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the package via Composer:

    composer require acti/am_i_up_to_date_sf
    

    Publish the config file (if needed):

    php artisan vendor:publish --provider="Acti\AmIUpToDateSF\ServiceProvider"
    
  2. Basic Usage Inject the AmIUpToDateSF facade or service into a controller/console command:

    use Acti\AmIUpToDateSF\Facades\AmIUpToDateSF;
    
    public function checkUpdates()
    {
        $result = AmIUpToDateSF::check();
        return response()->json($result);
    }
    
  3. First Use Case Verify if your Laravel app meets the minimum requirements (PHP version, Laravel version, dependencies) via a health check endpoint:

    public function healthCheck()
    {
        $status = AmIUpToDateSF::check();
        return $status['isUpToDate']
            ? response()->json(['status' => 'healthy'])
            : response()->json(['status' => 'outdated', 'details' => $status], 500);
    }
    

Implementation Patterns

Common Workflows

  1. Pre-Deployment Checks Integrate into CI/CD pipelines (GitHub Actions, GitLab CI) to block deployments if requirements aren’t met:

    # Example GitHub Actions step
    - name: Check Laravel/Composer Updates
      run: |
        php artisan vendor:publish --provider="Acti\AmIUpToDateSF\ServiceProvider"
        php artisan check:updates
    
  2. Admin Dashboard Integration Display update status in an admin panel:

    // In a Blade view
    @php
        $updateStatus = AmIUpToDateSF::check();
    @endphp
    <div class="alert alert-{{ $updateStatus['isUpToDate'] ? 'success' : 'warning' }}">
        System Status: {{ $updateStatus['isUpToDate'] ? 'Up to Date' : 'Outdated' }}
    </div>
    
  3. Scheduled Notifications Use Laravel’s scheduler to email/Slack admins when updates are available:

    // In App\Console\Commands\CheckUpdatesCommand.php
    public function handle()
    {
        $status = AmIUpToDateSF::check();
        if (!$status['isUpToDate']) {
            Notification::route('mail', ['admin@example.com'])
                ->notify(new UpdateAvailable($status));
        }
    }
    

    Schedule the command:

    * * * * * php artisan check:updates
    
  4. Custom Requirements Extend the checker for project-specific rules (e.g., database schema):

    // In config/am_i_up_to_date_sf.php
    'custom_checks' => [
        function () {
            return DB::table('migrations')->exists();
        },
        'Your database must have migrations applied.',
    ],
    

Gotchas and Tips

Pitfalls

  1. False Positives

    • The package checks installed versions (e.g., composer.json), not necessarily runtime (e.g., PHP CLI vs. FPM). Verify with:
      $phpVersion = PHP_VERSION;
      $requiredVersion = config('am_i_up_to_date_sf.php_requirements');
      
    • Fix: Use php -r "echo PHP_VERSION;" in CI/CD to match runtime.
  2. Overridden Config

    • If you publish the config but don’t modify it, the package defaults to strict mode (fails on any outdated dependency).
    • Fix: Explicitly set strict_mode in config/am_i_up_to_date_sf.php:
      'strict_mode' => false, // Allow warnings instead of failures
      
  3. Performance Impact

    • Running AmIUpToDateSF::check() in a loop (e.g., API endpoint) may slow responses.
    • Fix: Cache results for 1 hour:
      $status = Cache::remember('update_check', now()->addHours(1), function () {
          return AmIUpToDateSF::check();
      });
      
  4. Dependency Conflicts

    • The package may conflict with other update-checking tools (e.g., laravel-updater).
    • Fix: Disable duplicate checks in config:
      'exclude_packages' => ['laravel-updater'],
      

Debugging Tips

  • Detailed Output: Enable verbose mode in config:

    'verbose' => true,
    

    This logs all checks (PHP, Laravel, Composer) to storage/logs/laravel.log.

  • Custom Check Errors: If a lambda check fails, inspect the error message:

    $status = AmIUpToDateSF::check();
    if (isset($status['errors']['custom'])) {
        Log::error('Custom check failed:', $status['errors']['custom']);
    }
    

Extension Points

  1. Add New Check Types Extend the CheckInterface to support custom logic (e.g., AWS SDK version):

    namespace App\Checks;
    
    use Acti\AmIUpToDateSF\Contracts\CheckInterface;
    
    class AwsSdkCheck implements CheckInterface
    {
        public function check(): array
        {
            $version = \Aws\getSdk()->getVersion();
            return [
                'isValid' => version_compare($version, '3.0', '>='),
                'message' => 'AWS SDK must be >= 3.0',
            ];
        }
    }
    

    Register in config/am_i_up_to_date_sf.php:

    'custom_checks' => [
        App\Checks\AwsSdkCheck::class,
    ],
    
  2. Modify Response Format Override the AmIUpToDateSF facade binding to transform output:

    // In AppServiceProvider@boot()
    $this->app->bind(\Acti\AmIUpToDateSF\Facades\AmIUpToDateSF::class, function ($app) {
        return new class extends \Acti\AmIUpToDateSF\Facades\AmIUpToDateSF {
            public function check()
            {
                $result = parent::check();
                return collect($result['errors'])->keyBy('type')->toArray();
            }
        };
    });
    
  3. Silent Mode Suppress output for CLI scripts:

    $status = AmIUpToDateSF::check(['silent' => true]);
    
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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
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