1. Go to this page and download the library: Download laragear/capstone 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/ */
laragear / capstone example snippets
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Laragear\Capstone\HasCap;
use Laragear\Capstone\Keep;
class Draft extends Model
{
use HasCap;
/**
* Limits the model records in the table.
*/
public function keep(Keep $keep)
{
$keep->same('post_id')->by(10);
}
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Laragear\Capstone\HasCap;
use Laragear\Capstone\Keep;
class Draft extends Model
{
use HasCap;
public function keep(Keep $keep)
{
//
}
}
use Laragear\Capstone\Keep;
public function keep(Keep $keep)
{
$keep->same('post_id');
}
use Laragear\Capstone\Keep;
public function keep(Keep $keep)
{
$keep->same('post_id', 'user_id');
}
use Laragear\Capstone\Keep;
use Illuminate\Contracts\Database\Eloquent\Builder
public function keep(Keep $keep)
{
$keep->same(function (Builder $query) {
$query
->where('post_id', $this->post_id)
->whereRelation('post.user', 'is_vip', false)
});
}
use Laragear\Capstone\Keep;
public function keep(Keep $keep)
{
$keep->same('post_id')->by(10);
}
$keep->same('post_id')->all()->after('-14 days');
use Laragear\Capstone\Keep;
public function keep(Keep $keep)
{
$keep->same('post_id')->after('-14 days');
}