Skip to main content

Posts

Laravel one to one relationship with example

  Laravel one to one relationship with example “Laravel eloquent one to one relationship with example”: A one-to-one relationship is a very basic, fundamental Laravel eloquent relationship. Following our  complete guide to Laravel relationships , it simply relates one entity to another. For instance, in our voting application, a User is associated with one Vote. If we were to describe this relationship, we could say: “ Each user has one vote”. READ THE UPDATED VERSION HERE   Defining a one-to-one relationship In order to define this relationship, we call the  hasOne  method on the entity that owns the relationship. Here’s a code snippet defining the relationship. <?php namespace App \ Models ; use Illuminate \ Database \ Eloquent \ Model ; class User extends Model { /** * Get's this user's vote */ public function vote () { return $this ->hasOne(App\Models\Vote::class); } } What happens here is, we pass the n...
Recent posts

My Love For Canada

It seems like these days, many people love this country of my first love, Canada, i have always dreamt of being in it as a full fledged citizen having the right to do anything as stated by the law for every citizen, I have my reasons for such love but you can simply take a deep dive into discovering more about the country and why I have such a strong love for  this country here . timbu.com/canada

Create a nigerian news blog -4- Homepage Customization Finalized

12 Productive Tips for Backend Developers

Hey guys, i just drop a new video on my 12 productive tips as a backend developer . I want to hear your honest thoughts on this subject to assist others improve productivity. Thanks Read more of my 12 productive tips for backend developers  

Make Jaguda Website - 6 - Installing the Theme

How to create a music website step by step. In this tutorial our example website is jaguda website.

Make Jaguda Website - 4 - Overview of wordpress

Java Login Tutorial Using MySQL, Access And SQLite - 1 - Creating the Lo...