PHP code example of keendigit / laravel-cms

1. Go to this page and download the library: Download keendigit/laravel-cms 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/ */

    

keendigit / laravel-cms example snippets




namespace Extensions\MyExtension;

use App\Extensions\BaseExtension;

class Extension extends BaseExtension
{
    public function getId(): string
    {
        return 'my-extension';
    }
    
    public function info(): array
    {
        return [
            'name' => 'My Extension',
            'version' => '1.0.0',
            'description' => 'A sample extension',
            'author' => 'Your Name',
        ];
    }
    
    public function providers(): array
    {
        return [
            \Extensions\MyExtension\Providers\MyExtensionServiceProvider::class,
        ];
    }
}

// extensions/my-extension/config/settings.php
return [
    'api_endpoint' => env('MY_EXTENSION_API_ENDPOINT', 'https://api.example.com'),
    'cache_ttl' => env('MY_EXTENSION_CACHE_TTL', 3600),
    'features' => [
        'notifications' => env('MY_EXTENSION_NOTIFICATIONS_ENABLED', true),
    ],
];
bash
# Run tests
php artisan test

# Run with coverage
php artisan test --coverage