PHP code example of reyhan-commerce / core

1. Go to this page and download the library: Download reyhan-commerce/core 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/ */

    

reyhan-commerce / core example snippets


use Reyhan\Core\ReyhanCorePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->default()
        ->id('admin')
        ->plugin(ReyhanCorePlugin::make());
}

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use Reyhan\Core\Facades\Reyhan;
use App\Models\CustomProduct;
use App\Models\CustomOrder;

final class AppServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        // Replace default models at runtime
        Reyhan::useModel('product', CustomProduct::class);
        Reyhan::useModel('order', CustomOrder::class);
    }
}