2
votes

UI Code: in resources\views\DistributorRegistration.php

<?php
class DistributorRegitrationForm
{
    public function distributorRegitrationFormHtml(){
        return  '<h1>Hello</h1>';
    }
}
?>

In Controler Class.....

namespace App\Http\Controllers;

use App\User;

use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

use resources\views\DistributorRegistration;

class DistributorRegistration extends Controller
{
    function VestigePOS_GRNHandler(Request $request){
        $id = $request->input('id');
        return view(DistributorRegitrationForm::distributorRegitrationFormHtml()) ;
    }
}

When I call this controller in routes

Fatal error: Class 'App\Http\Controllers\DistributorRegitrationForm' not found

1

1 Answers

0
votes
  1. Which file contains the class DistributorRegitrationForm? I'm missing an use App\...\DistributorRegitrationForm; in the controller, if it's not in the same namespace.
  2. Calling DistributorRegitrationForm::distributorRegitrationFormHtml() won't work, unless the method becomes a static method (public static function).
  3. You have some typos in there ;-)