Laravel, get id from newly created object
<p>i'm using laravel 5.2 and i need get the id of the newly created object in the same function in a controller to create another object with this attribute.</p>

<p>This is the function in the controller:</p>

<pre><code>public function store(Request $request)
    {
        Movie::create([
            'usuario_id' =&gt; $request['usuario_id'],
            'asignatura_id' =&gt; $request['asignatura_id'],
            'name' =&gt; $request['name'],
            'visit' =&gt; $request['visit'],
            'language' =&gt; $request['language'],
        ]);

        Subtitle::create([
            'url' =&gt; $request['subtitle'],
            ]);
        return "OK";
    }
</code></pre>

<p>I need the id of this Movie to create a new Subtitle because the id is a foreign key in Subtitle. Thanks for the answers.</p>