Answers for "laravel expose columns model"

PHP
1

laravel model with methos custom columns

//with com colunas específicar (relações com colunas específicas)
->with([
    'unidade' => function($query) {
        $query->select('id','nome',);
    },
    'usuario' => function($query) {
        $query->select('id','name',);
    },
])
Posted by: Guest on July-02-2021

Browse Popular Code Answers by Language