This commit is contained in:
2018-04-06 10:48:39 +02:00
parent 6f6cda4125
commit 49bd541cb8
10 changed files with 169 additions and 49 deletions
+1 -2
View File
@@ -15,7 +15,7 @@ class Document extends BaseModel {
return $this->belongsTo( 'User' );
}
public static function getDocuments( $foreignID, $tablename )
public static function getDocuments( $foreignID)
{
$documents = Document::orderBy( 'uploaddate', 'desc' )
->with( [
@@ -23,7 +23,6 @@ class Document extends BaseModel {
$q->selectRaw( "CONCAT(firstname, ' ', middlename, ' ', lastname) AS fullname, id" );
}] )
->whereForeignId( $foreignID )
->whereForeignTable( $tablename )
->get();
return $documents;