Hello I have an error when calling the authorization in the controller
public function destroy($id)
{
if (auth()->check()) {
if (request()->method('delete')) {
try {
$stream = Stream::findOrFail($id);
$this->authorize('delete', Stream::class);
} catch (ModelNotFoundException $e) {
return response()->json(['status' => "error", 'message' => 'No existe lo buscado'], 409);
}
} else {
# code...
}
} else {
# code...
}
}
BadMethodCallException in Controller.php line 82:
Method [authorize] does not exist.
This isn't related to the package.
Looks like your method authorize was not found.
reviewing your library found something and made a change in her
use Illuminate\Routing\Controller;
for
use Nwidart\Modules\Routing\Controller;
in controller
do not know if I'm doing something wrong with her and excuse my English but not speak Spanish will write
You don't have to use that controller, you can just use laravel's base controller.
Most helpful comment
reviewing your library found something and made a change in her
use Illuminate\Routing\Controller;
for
use Nwidart\Modules\Routing\Controller;
in controller