本文整理汇总了PHP中app\Client::user方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::user方法的具体用法?PHP Client::user怎么用?PHP Client::user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Save a new client to the database
*
* @param ClientRequest $request The incoming request.
*
* @return Response
*/
public function store(ClientRequest $request)
{
$client = new Client();
$client->active = (int) $request->active;
$client->name = $request->name;
$client->contactName = $request->contactName;
$client->contactEmail = $request->contactEmail;
$client->address1 = $request->address1;
$client->address2 = $request->address2;
$client->city = $request->city;
$client->locality = $request->locality;
$client->postalCode = $request->postalCode;
$client->phone = $request->phone;
$client->user()->associate($request->user());
$client->save();
$userMessage = $this->successMessage('client');
return redirect()->route('client.show', [$client->id])->with('userMessage', $userMessage);
}