PHP code example of orchestra / memory

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

    

orchestra / memory example snippets


'providers' => [

  // ...

  Orchestra\Memory\MemoryServiceProvider::class,

],

'aliases' => [

  // ...

  'Memory' => Orchestra\Support\Facades\Memory::class,

],

$runtime  = Memory::make('runtime');
$fluent   = Memory::make('fluent');
$eloquent = Memory::make('eloquent');
$cache    = Memory::make('cache');

$memory = Memory::make();

$memory->put('site.author', 'Taylor');

// or you can also use
Memory::put('site.author', 'Taylor');

$name = $memory->get('site.author');

// or you can also use
$name = Memory::get('site.author');

$name = $memory->get('site.author', 'Fred');

$memory->forget('site.author');

// or you can also use
Memory::forget('site.author');



use Orchestra\Contracts\Memory\Handler;

class AcmeMemoryHandler implements Handler
{
  // Add your implementation
}

Memory::extend('acme', function ($app, $name) {
  return new Orchestra\Memory\Provider(
    new AcmeMemoryHandler($name)
  );
});

// Now you can use it as
$acme = Memory::make('acme.default');
bash
php artisan vendor:publish --provider="Orchestra\\Memory\\MemoryServiceProvider"