Squashed commit of the following:
commit e29339b2084e4531164a2904869460c4928a6d03 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:35:29 2016 +0000 Remove algolia credit commit 2ee543b8d37bcf008a8e82a72202420a48f2b38e Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:34:02 2016 +0000 Updated and added dependencies commit 5aba9dda8a8a5c5e9837f409a3991d2d4f4bd8c2 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:29:57 2016 +0000 Add relavent model options for postgres searching with scout commit ace894529d12773997336c4acbfe77f157d00eb7 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:28:47 2016 +0000 Add pgsql scout option commit 7c794fd35af0ef53d005a8d68d3b99316312536d Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:28:06 2016 +0000 Add the PostgresEngine service provider commit 19ba7c2e7d103302209151244ec6a11b3fab3e13 Author: Jonny Barnes <jonny@jonnybarnes.uk> Date: Tue Dec 6 20:27:09 2016 +0000 Add the searchable column and index to the notes table
This commit is contained in:
parent
bfce76b94e
commit
bd92f1d6c8
8 changed files with 121 additions and 75 deletions
19
app/Note.php
19
app/Note.php
|
@ -62,6 +62,13 @@ class Note extends Model implements HasMedia
|
|||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* Hide the column used with Laravel Scout.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = ['searchable'];
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
*
|
||||
|
@ -69,6 +76,18 @@ class Note extends Model implements HasMedia
|
|||
*/
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
/**
|
||||
* Set the attributes to be indexed for searching with Scout.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toSearchableArray()
|
||||
{
|
||||
return [
|
||||
'note' => $this->note,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* A mutator to ensure that in-reply-to is always non-empty or null.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue