How to show data by id in laravel 5.2 <p>I want to show data by id. If id=1 its need to show only id=1 data and if id 2 its should show only id=2 all data. My controller method:</p> <pre><code>-&gt;with('classroom',classroomModel::find($id)-&gt;first()); </code></pre> <p>Here is my view:</p> <pre><code>&lt;li&gt;Class code--&gt;{{$classroom-&gt;class_code}}&lt;/li&gt; &lt;li&gt;Subject--&gt;{{$classroom-&gt;subject_name}}&lt;/li&gt; &lt;li&gt;Section--&gt;{{$classroom-&gt;section}}&lt;/li&gt; </code></pre> <p>now it is only show id=1 data. If i view id=2 data then it's show id=1 data. What should to do in my controller?</p>