Laravel simple relation between models return null <p>In my database I have <code>users</code> and <code>tickets</code> table. Now I want to create simple relation between theme, in <code>phpmyadmin</code> relation created between <code>tickets.userId</code> and <code>users.id</code>, now I wrote some functions on models:</p> <p>User model:</p> <pre><code>public function tickets() { return $this-&gt;hasMany('App\Tickets'); } </code></pre> <p>Tickets model:</p> <pre><code>public function user() { return $this-&gt;belongsTo('App\User'); } </code></pre> <p>This code as <code>dd(\App\Tickets::with('user')-&gt;get());</code> return null on relation result, for example:</p> <pre><code>0 =&gt; Tickets {#209 ▼ #table: "tickets" #connection: null #primaryKey: "id" #keyType: "int" #perPage: 15 +incrementing: true +timestamps: true #attributes: array:9 [▶] #original: array:9 [▶] #relations: array:1 [▼ "user" =&gt; null ] </code></pre>