PHP code example of ultraviolettes / constellation-for-laravel

1. Go to this page and download the library: Download ultraviolettes/constellation-for-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ultraviolettes / constellation-for-laravel example snippets


use Ultraviolettes\Constellation\Contracts\Collector;
use Ultraviolettes\Constellation\Snapshot\{Section, Status, Window};

final class SeoCollector implements Collector
{
    public function key(): string
    {
        return 'seo';
    }

    public function collect(Window $window): Section
    {
        return Section::make($this->key(), Status::Ok, ['broken_links' => 0], now()->toImmutable());
    }
}
bash
php artisan queue:restart        # or: php artisan horizon:terminate
bash
php artisan about --only=constellation        # token, endpoint, cache, last send, workers
php artisan monitor:send --dry-run --pretty   # print the payload, send and write nothing
php artisan monitor:send --sync               # send immediately and print the outcome
php artisan monitor:send                      # queue the send (what the scheduler does)
bash
php artisan vendor:publish --tag=constellation-config