Skip to content

Commit 0d69c88

Browse files
committed
"resource not found" behaviour in config
1 parent 23661f8 commit 0d69c88

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

config/config.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,19 @@
112112
}
113113
},
114114

115+
/*
116+
|--------------------------------------------------------------------------
117+
| 'Resource not found' function
118+
|--------------------------------------------------------------------------
119+
|
120+
| Default behaviour in case 'resource not found'
121+
|
122+
*/
123+
124+
'resourceNotFound' => function ()
125+
{
126+
return null;
127+
},
128+
115129

116130
];

src/JsonServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function GET()
9292
if ($result) {
9393
return $result->toArray();
9494
} else {
95-
return null;
95+
return call_user_func(Config::get('resourceNotFound'));
9696
}
9797
}
9898

0 commit comments

Comments
 (0)