Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Seif5's avatar

save model angular contain forgein key

I can't get user_id (forgien key) value into my history table. I have 3 tables here ; (users, questions,history) If the user answer the question I should store his answer on the history table

how can I get user_ID from angularJS file Historycontroller.php

    public function index(Request $request)
    {
           $historiques = History::all();
           return $historiques;

    }

Thanks!

0 likes
1 reply
Seif5's avatar

Can any one help me on that please

Please or to participate in this conversation.