skip to Main Content

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 IlluminateContractsViewView|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

3

Answers


  1. Try

    composer install
    

    then

    composer update
    

    then

    composer dump-autoload
    

    then

    php artisan config:cache
    
    Login or Signup to reply.
  2. just Try

    php artisan view:clear

    Login or Signup to reply.
  3. Rename component class name, it must start with uppercase letter.

    class ClassName extends Component{
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search