I have an Event class in Laravel as Controller class. Here is the namespace.
namespace App\Http\Controllers\Admin;
This is the class starting code and constructor.
class EventController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }
And here is the function name and definition
    function generateBarcodeNumber() {
    $number = mt_rand(1000000000, 9999999999); // better than rand()
    // call the same function if the barcode exists already
    if (barcodeNumberExists($number)) {
        return generateBarcodeNumber();
    }
    // otherwise, it's valid and can be used
    return $number;
}
function barcodeNumberExists($number) {
    // query the database and return a boolean
    // for instance, it might look like this in Laravel
    return User::whereBarcodeNumber($number)->exists();
}
I am calling this function in another function using $this keyword as
$event->slug_str = $this->generateBarcodeNumber();
And this is the error:
Call to undefined function App\Http\Controllers\Admin\barcodeNumberExists()
Thanks!
 
    