PHP code example of bluefyn-international / sidekick

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

    

bluefyn-international / sidekick example snippets


$ids = AlwaysOpen\Helpers\Strings::stringIdsToCollection('1,3,45, asdf,66,1,45,3');
var_dump($ids);

return response()->redirectTo(
    AlwaysOpen\Helpers\Routes::toRouteIfBackIsLoop('user.report')
);



namespace App\Models;

namespace AlwaysOpen\Sidekick\Models\Traits\ByName;

class OrderStage extends Model
{
    use ByName;
    
    const NEXT_DAY = 'Next Day';
   ...
}

$overnight = OrderStage::byName('overnight');

$overnight = OrderStage::byName(OrderStage::NEXT_DAY);

class LineItem extends Model
{
    use CascadeUpdate;

    public function getRelationshipsToUpdate() : array
    {
        return [
            'Document',
        ];
    }

    public function CascadeUpdate() : HasOne