Home > database >  view not found exception-laravel
view not found exception-laravel

Time:01-11

View [cart] not found. {"exception":"[object] (InvalidArgumentException(code: 0): View [cart] not found. at C:\\wamp\\www\\projects\\BBT\\vendor\\laravel\\framework\\src\\Illuminate\\View\\FileViewFinder.php:137)

I've created a notification & tried to use the cart.blade.php as the mail template as below. But am getting the above error. i've already tried clearing cache by going through this link: https://stackoverflow.com/questions/17913929/laravel-view-not-found-exception

namespace App\Notifications;
class CartExpiryNotification extends Notification
{
    public function toMail($notifiable)
    {
        return (new MailMessage)
            ->view('cart', ['cartTemplate' => 'cartTemplate']);
    }
}

cart.blade.php

{{$cartTemplate}}

cart.blade.php is existing in the path C:\wamp\www\projects\BBT\vendor\laravel\framework\src\Illuminate\Notifications\resources\views\cart.blade.php .

CodePudding user response:

Your views should be inside following root directory

your_project_name/app/resources/views/cart.blade.php
  •  Tags:  
  • Related