. */ namespace App\View\Components; use Illuminate\View\Component; class Alert extends Component { public $alertType; public $extraStyling; public $title; public $icon; /** * Create a new component instance. * * @param string $alertType The color the alert should have. * @param string $title The alert's title * @param string $icon The alert's icon, placed before the title * @param string $extraStyling Any extra CSS classes to add */ public function __construct(string $alertType, string $title = '', string $icon = '', string $extraStyling = '') { $this->alertType = $alertType; $this->extraStyling = $extraStyling; $this->icon = $icon; $this->title = $title; } /** * Get the view / contents that represent the component. * * @return \Illuminate\View\View|string */ public function render() { return view('components.alert'); } }