'Laravel Blade component method not rendering in cpanel-server but work in my localhost

I have a component RemoveBook in app/View/Components/RemoveBook and the blade component in resources/views/components/sections/parts/remove-book.blade.php.

all working fine on localhost but on the server - Cpanel - not rendering

component code

public $route;
public $bookid;
/**
 * Create a new component instance.
 *
 * @return void
 */
public function __construct($route, $bookid)
{
    $this->route = $route;
    $this->bookid = $bookid;
}

/**
 * Get the view / contents that represent the component.
 *
 * @return \Illuminate\Contracts\View\View|\Closure|string
 */
public function render()
{
    $this->route = Request::is('myBook*') ? 'myBook.destroy' : 'wishList.destroy';
    return view('components.sections.parts.remove-book');
}

in view

{!! Form::open(['route' => [$route, $bookid], 'method' => 'delete']) !!}
<div class="absolute top-0 right-0">
    <button class="w-35-px h-35-px bg-brand-black text-white border hover:opacity-100">
        X
    </button>
</div>
{!! Form::close() !!}

and more than 5 components not rendering on the server - all components - but on localhost all working fine

enter image description here

enter image description here



Solution 1:[1]

Try

composer install

then

composer update

then

composer dump-autoload

then

php artisan config:cache

Solution 2:[2]

just Try

php artisan view:clear

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mostafa Hana
Solution 2 Parmar Sunil