<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    /**
    *
    * Check result
    *
    */
    public function isFound($result)
    {
        if (count($result) === 0 ) {
            abort(404);
        }
    } 
}

<?php

namespace App\Http\Controllers;

use Laravel\Lumen\Routing\Controller as BaseController;

class Controller extends BaseController
{
    //
}

--- 
+++ 
@@ -6,5 +6,15 @@
 
 class Controller extends BaseController
 {
-    //
+    /**
+    *
+    * Check result
+    *
+    */
+    public function isFound($result)
+    {
+        if (count($result) === 0 ) {
+            abort(404);
+        }
+    } 
 }
Add method check result repository
