Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
'use strict';
const { isFunction } = require('../helpers/is');
module.exports = function firstOrFail(key, operator, value) {
if (isFunction(key)) {
return this.first(key, () => {
throw new Error('Item not found.');
});
}
const collection = this.where(key, operator, value);
if (collection.isEmpty()) {
throw new Error('Item not found.');
}
return collection.first();
};