Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Scout\Searchable;
trait BuildBehaviour
use Searchable;
public function shortSha()
return substr($this->sha, 0, 7);
public function scopePublished($query)
return $query
->where('status', 'published')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment