Hello,
In your code you're resolving the Tag class as follows
use App\Tag; // <-- This is right
But in your method you're calling
$pages->tags()->saveMany([
new App\Tag(), // <-- And this is wrong!
new App\Tag(),
]);
You simply have to call new Tag() since the use at the top of your file has already included the class.
Otherwise PHP will try to resolve the class from the current namespace. That's why it's throwing
Class 'App\Http\Controllers\App\Tag' not found
Hope this work!!
Thank YoU!