Hii @kartik,
Create a new middleware, add to 'web' $middlewareGroups in Kernel.php. This will call the artisan command to clear all compiled view files.
namespace App\Http\Middleware;
use Artisan;
use Closure;
class ClearViewCache
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (env('APP_ENV') === 'local') {
Artisan::call('view:clear');
}
return $next($request);
}
}
Thank You!!