PHP code example of laracasts / matryoshka
1. Go to this page and download the library: Download laracasts/matryoshka 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/ */
laracasts / matryoshka example snippets
Cache::tags('views')->flush();
use Laracasts\Matryoshka\Cacheable;
class Post extends Eloquent
{
use Cacheable;
}
namespace App;
use Laracasts\Matryoshka\Cacheable;
use Illuminate\Database\Eloquent\Model;
class Note extends Model
{
use Cacheable;
protected $touches = ['card'];
public function card()
{
return $this->belongsTo(Card::class);
}
}
html
@cache($card)
<article class="Card">
<h2>{{ $card->title }}</h2>
<ul>
@foreach ($card->notes as $note)
@