N
N
nionly_quantum2020-05-11 22:10:21
PHP
nionly_quantum, 2020-05-11 22:10:21

Trying to get property 'id' of non-object?

public function createPayment(Request $r){
          $amount = '1';
          $payway = $r->type_curr;
          $shop_id_freekassa = '123';
          $secret_word_freekassa = '123';
        // не помогает $user = User::where('id', $user->user_id)->first(); 
          $order = Order::create([
              'user_id' => $this->user->id, // ошибка тут
              'amount' => $amount
          ]);

              $sign = md5($shop_id_freekassa . ':' . $amount . ':' . $secret_word_freekassa . ':' . $order->id);

              return redirect('http://www.free-kassa.ru/merchant/cash.php?m=' . $shop_id_freekassa . '&oa=' . $amount . '&o=' . $order->id . '&s=' . $sign);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question