Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too few arguments to function Gloudemans AND Non-static method Gloudemans #51

Open
omidemehr opened this issue Aug 2, 2022 · 0 comments

Comments

@omidemehr
Copy link

Too few arguments to function Gloudemans

Too few arguments to function Gloudemans\Shoppingcart\Cart::__construct(), 0 passed in C:\Users....php on line 11 and exactly 2 expected

private $instance;

/**

 * Cart constructor.

 *

 * @param \Illuminate\Session\SessionManager      $session

 * @param \Illuminate\Contracts\Events\Dispatcher $events

 */

**------> -----> ------> public function __construct(SessionManager $session, Dispatcher $events)**

{

    $this->session = $session;

    $this->events = $events;


    $this->instance(self::DEFAULT_INSTANCE);

}


/**

 * Set the current cart instance.

 *

 * @param string|null $instance

 * @return \Gloudemans\Shoppingcart\Cart

 */

public function instance($instance = null)

AAAAAAANNNNNNNNDDDDDDD


and
Non-static method Gloudemans\Shoppingcart\Cart::add() cannot be called statically

namespace App\Http\Livewire\Test;

use \Gloudemans\Shoppingcart\Cart;
use Livewire\Component;

class TestExample extends Component
{
function addd(){
Cart::add('192ao12', 'Product 1', 1, 9.99);
Cart::add('1239ad0', 'Product 2', 2, 5.95, ['size' => 'large']);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant