V
V
Vladislav2017-04-17 10:58:36
Laravel
Vladislav, 2017-04-17 10:58:36

Why might an error occur?

The mistake itself

Type error: Too few arguments to function App\Http\Controllers\RegistrationController::store(), 1 passed and exactly 2 expected

Controller
public function store(Request $request, $id)
    {

        $token = str_random(32);

        $users =  [
            'name' => request('name'),
            'email' => request('email'),
            'password' => request('password'),
            'user_token' => ($token),
        ];


        $device= Device::find($id);
        dd($device);

        $users = Sentinel::registerandActivate($users);

        $users->devices()->attach( $device);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DeadMemories, 2017-04-17
@DeadMemories

The 'store' method confuses me. Why does it accept $id ?
Show router

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question