Php 如何通过id获取格式/证书的名称

Php 如何通过id获取格式/证书的名称,php,database,laravel,Php,Database,Laravel,因此,我的数据库中有两个表:career\u solutions\u format和career\u solutions\u certification,它们都有列id和category,这是每个格式/证书的名称 现在,$career\u solution->topic\u format\u id与列id相等,如1,3,5。因此,我需要显示这些的名称,从列category 这是我的控制器: $data['formatList'] = [''=>'Format'] + \App\Format

因此,我的数据库中有两个表:
career\u solutions\u format
career\u solutions\u certification
,它们都有列
id
category
,这是每个格式/证书的名称

现在,
$career\u solution->topic\u format\u id
与列
id
相等,如1,3,5。因此,我需要显示这些的名称,从列
category

这是我的控制器:

$data['formatList'] = [''=>'Format'] + \App\Format::lists('category','id')->toArray();
$data['certificationList'] = [''=>'Certification'] + \App\Certification::lists('category','id')->toArray();
以下是我的观点:

{!! Form::select('topic_certification_id',$certificationList,null,['required']) !!}

我如何使此行显示id的名称,而不是id?我从表
career\u solutions
、列
topic\u format\u id
中获取id,我需要在该列和表
career\u solutions\u format
中的列
category
之间进行连接,它应该可以工作,问题是,我从表
career\u solutions
、列
topic\u format\u id
中获取id,我需要在该列和表
career\u solutions\u format
中的列
category
之间建立一个表关系,然后编写一个连接查询以显示名称。确保桌子正常化