This is my code Main.php
<?php
namespace App\Nova\Dashboards;
use Acme\WelcomeCard\WelcomeCard;
use Laravel\Nova\Dashboards\Main as Dashboard;
class Main extends Dashboard
{
/**
* Get the cards for the dashboard.
*
* @return array
*/
public function cards()
{
return [
new WelcomeCard,
];
}
}
nova-components/WelcomeCard/src/WelcomeCard.php
<?php
namespace Pt1App\WelcomeCard;
use Laravel\Nova\Card;
class WelcomeCard extends Card
{
/**
* The width of the card (1/3, 1/2, or full).
*
* @var string
*/
public $width = '1/3';
/**
* Get the component name for the element.
*
* @return string
*/
public function component()
{
return view('welcome-card', [
'title' => 'Welcome to Laravel Nova',
'message' => 'Thank you for using Laravel Nova!',
]);
}
}
Providers/NovaServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Nova\Nova;
use Laravel\Nova\NovaApplicationServiceProvider;
use App\Nova\WelcomeScreen;
use Pt1App\WelcomeCard\WelcomeCard;
class NovaServiceProvider extends NovaApplicationServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
parent::boot();
Nova::cards([
WelcomeCard::make()
]);
}
/**
* Register the Nova routes.
*
* @return void
*/
protected function routes()
{
Nova::routes()
->withAuthenticationRoutes()
->withPasswordResetRoutes()
->register();
}
/**
* Register the Nova gate.
*
* This gate determines who can access Nova in non-local environments.
*
* @return void
*/
protected function gate()
{
Gate::define('viewNova', function ($user) {
return in_array($user->email, [
//
]);
});
}
/**
* Get the dashboards that should be listed in the Nova sidebar.
*
* @return array
*/
protected function dashboards()
{
return [
new \App\Nova\Dashboards\Main,
];
}
/**
* Get the tools that should be listed in the Nova sidebar.
*
* @return array
*/
public function tools()
{
return [];
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Error
Class Pt1App\WelcomeCard\WelcomeCard not found.
Please check and let me know what I am missing here.