本文整理汇总了PHP中Lead::users方法的典型用法代码示例。如果您正苦于以下问题:PHP Lead::users方法的具体用法?PHP Lead::users怎么用?PHP Lead::users使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lead
的用法示例。
在下文中一共展示了Lead::users方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store()
{
$v = Validator::make($data = Input::all(), Lead::$rules);
if ($v->fails()) {
return Response::json(array('flash' => 'Something went wrong, try again !'), 500);
} else {
$lead = new Lead();
$user = Sentry::getUser();
$lead->salutation = Input::get('salutation');
$lead->first_name = Input::get('first_name');
$lead->last_name = Input::get('last_name');
$lead->phone = Input::get('phone');
$lead->email = Input::get('email');
$lead->instance = Input::get('instance');
$lead->address = Input::get('address');
$lead->address2 = Input::get('address2');
$lead->description = Input::get('description');
$lead->status_id = Input::get('status_id');
$lead->save();
$lead->users()->attach($user, array('notes' => 'User ini yang mengawali lead ini'));
return Response::json(array('success' => true, 'flash' => 'New lead has been successfully created !'), 200);
}
}