PHP code example of nicolaskion / sde

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

    

nicolaskion / sde example snippets


use NicolasKion\SDE\Models\Solarsystem;
use NicolasKion\SDE\Models\Type;

// A ship with its group, market group and dogma attributes
$rifter = Type::query()
    ->with(['group', 'marketGroup', 'typeAttributes'])
    ->where('name', 'Rifter')
    ->first();

// All low-sec systems in a region, with their stations
$systems = Solarsystem::query()
    ->with(['constellation', 'stations'])
    ->whereBetween('security', [0.1, 0.45])
    ->whereRelation('region', 'name', 'Heimatar')
    ->get();

// config/sde.php
'models' => [
    'Type' => App\Models\Type::class,
    // ...
],

use Illuminate\Support\Facades\Schedule;

Schedule::command('sde:download')->weekly()->mondays()->at('11:30');
Schedule::command('sde:seed')->weekly()->mondays()->at('12:00');
bash
php artisan vendor:publish --tag="sde-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="sde-config"
bash
php artisan sde:download
bash
php artisan sde:seed
bash
php artisan vendor:publish --tag="sde-models"