PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

How to Insert Relationship Via Controller

Solved
keshan-sandeepa

Sep 4th, 2018 09:44 AM

Hello , I have 2 models , one is user other one is register , "User hasone register " i need to create that relationship , Problem is even i created data is not saving in database, here is the screen shots in my code :

  1. Register Model https://imgur.com/a/xdEZthE
  2. User Model https://imgur.com/a/EMY8n76

Here is my controller Screenshot

  1. https://imgur.com/a/UuFLLJA

Problem is itsnot saving when user fill my form , How to fixed that . help me =D

mark

Sep 5th, 2018 11:40 AM

Best Answer

Add $customer->save(); after $customer->id = $request->user_id;.


Best Regards,
Mark Topper (Maintainer of Laravel Voyager)
Mail: [email protected]
I am available for freelance work - hire me