Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

Thank's but I need find the employee_id located on User model and get id of the row for insert on user_id field, this an example of my idea

public function store(Request $request)
{
$employee_id=$request->get('employee_id');   <- I tried this
$employee_id=$request->employee_id;             <- And this but no results.
$user=User::where('employee_id','=','$employee_id')->get();
Workshop::create([
'status' => $request->get('status'),
'issue' => $request->get('issue'),
'vehicle_id' => $request->get('vehicle_id'),
'user_id' => $request->get($user->id)
]);
}
Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

njuarezgt njuarezgt Joined 2 Oct 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.