you can use this type of method for one to one or one to many
public function yourmethod(){ return Modalnamewhereyouwanttoretrive::where('yourcolmn',$this->foreign_key)->get(); }
More Related Contents:
- How to use multiple databases in Laravel
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- Get the Last Inserted Id Using Laravel Eloquent
- How to do this in Laravel, subquery where in
- Laravel OrderBy relationship count
- Laravel 5.2 – Use a String as a Custom Primary Key for Eloquent Table becomes 0
- Laravel $q->where() between dates
- Laravel – Database, Table and Column Naming Conventions?
- Laravel nested relationships
- Eloquent many-to-many-to-many – how to load distant relation easily
- Eloquent groupBy make “SQLSTATE[42000]” with valid SQL query in Laravel 5.3
- How to Create Multiple Where Clause Query Using Laravel Eloquent?
- Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) in
- How to upload images into MySQL database using PHP code
- Laravel 5 PDOException Could Not Find Driver
- MySQL check if a table exists without throwing an exception
- Laravel 4: how to “order by” using Eloquent ORM [duplicate]
- Selecting a float in MySQL
- belongsToMany relationship in Laravel across multiple databases
- How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?
- How to Make Laravel Eloquent “IN” Query?
- Update without touching timestamps (Laravel)
- laravel collection to array
- Laravel Eloquent sort by relation table column
- mysql injection damages?
- A __construct on an Eloquent Laravel Model
- PHP Laravel: No connection could be made because the target machine actively refused it
- Auto Increment skipping numbers?
- How to get last inserted id from table MySQL [duplicate]
- find in set in laravel ? example