本文整理汇总了PHP中app\Client::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::create方法的具体用法?PHP Client::create怎么用?PHP Client::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Client
的用法示例。
在下文中一共展示了Client::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('clients')->truncate();
//insert some dummy records
Client::create(['name' => 'Idea7', 'country' => 'IN', 'status' => 'active']);
Client::create(['name' => 'Sunpharma', 'country' => 'IN', 'status' => 'active']);
}
示例2: store
public function store(Request $request)
{
$this->validate($request, ['name' => 'required', 'birth' => 'required', 'address' => 'required', 'phone' => 'required']);
$request['created_at'] = Carbon::now();
Client::create($request->all());
return view('client.new')->with('success', 'Cliente cadastrado com sucesso!');
}
示例3: handleAction
public function handleAction(Request $request)
{
$action = $request->input('_action');
if ($action == 'createClient') {
//Creation :
Client::create($request->all());
// FLash messaging :
flash()->success('Opération réussie!', 'Client créé avec succès.');
} else {
if ($_POST['_action'] == 'getClientByID') {
$id = $_POST['_uid'];
$client = Client::where('id', $id)->with('files')->first();
return response(['status' => 'success', 'client' => $client], 200);
} else {
if ($_POST['_action'] == 'editClient') {
$id = $_POST['id'];
$client = Client::find($id);
$client->lastname = $_POST['lastname'];
$client->firstname = $_POST['firstname'];
$client->email = $_POST['email'];
$client->street = $_POST['street'];
$client->postal_code = $_POST['postal_code'];
$client->city = $_POST['city'];
$client->vat = $_POST['tva'];
$client->mobile = $_POST['mobile'];
$client->office = $_POST['office'];
$client->fax = $_POST['fax'];
$client->save();
flash()->success('Opération réussie!', 'Client modifé avec succès.');
} else {
}
}
}
return redirect('/clients');
}
示例4: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$input = Input::all();
$this->validate($request, ['Name' => 'required|string', 'PhoneNo' => 'required|digits:11', 'Address' => 'required', 'Email' => 'email']);
Client::create($input);
return Redirect::route('clients.index')->with('message', 'Client created');
}
示例5: run
public function run()
{
$client = Client::create(['name' => 'Exhibit Partners', 'address' => '7700 68th Ave N', 'city' => 'Minneapolis', 'state' => 'MN', 'zip' => '55428']);
User::create(['name' => 'Bill Gench', 'email' => 'bill@exhibitpartners.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
User::create(['name' => 'Seth Phillips', 'email' => 'seth.phillips@trms.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
User::create(['name' => 'Debs Holloway', 'email' => 'DebS@exhibitpartners.com', 'client_id' => $client->id, 'password' => bcrypt('trms'), 'is_admin' => true]);
}
示例6: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$this->validate($request, ['name' => 'required|string|max:255', 'tax_number' => 'string|max:255|unique:clients', 'street' => 'string|max:255', 'city' => 'string|max:255', 'postal_code' => 'integer']);
$client = Client::create(['name' => $request->get('name'), 'tax_number' => $request->get('tax_number'), 'street' => $request->get('street'), 'city' => $request->get('city'), 'postal_code' => $request->get('postal_code')]);
flash()->success('Client created!');
return redirect()->route('clients.index');
}
示例7: store
public function store(ClientRequest $request)
{
Client::create($request->all());
//AFTER the row is added, get the last record to pass to the next page.
$client = Client::latest()->first();
\Session::flash('flash_message', 'Client ' . $client->first_name . ' ' . $client->last_name . ' was created.');
return redirect('clients');
}
示例8: create
/**
* create client
* @param Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function create(Request $request)
{
//validation
$this->validation($request);
//insert client
$client = Client::create(['name' => $request->get('name'), 'gender' => $request->get('gender')]);
return response()->json(['id' => $client->id]);
}
示例9: store
public function store(Request $request)
{
$currentPage = 'cocinas';
$pedido = new KitchenRequest($request->input('pedido'));
$pedido->secciones = $request->input('secciones');
Client::create($request->input('cliente'))->kitchenRequests()->save($pedido);
return view('pages.cocinasCreate', ['posted' => true] + compact('currentPage'));
}
示例10: store
public function store(StoreColdRoomRequest $request)
{
$cliente = $request->input('cliente');
$pedido = $request->input('pedido');
$currentPage = 'cuartos';
Client::create($cliente)->coldRoomRequests()->create($pedido);
return view('pages.cuartosCreate', ['posted' => true] + compact('currentPage'));
}
示例11: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $clientRequest)
{
$this->validate($clientRequest, ['first_name' => 'required', 'last_name' => 'required', 'company_name' => 'required', 'email' => 'required', 'address' => '', 'zipcode' => '', 'city' => '', 'primary_number' => '', 'secondary_number' => '', 'industry' => '', 'company_type' => '', 'fk_user_id' => 'required']);
$input = $clientRequest->all();
Client::create($input);
//dd($input);
Session::flash('flash_message', 'Client successfully added!');
return redirect()->route('clients.index');
}
示例12: store
/**
* Store a newly created resource in storage.
* POST: /client.
*
* @return Response
*/
public function store(Request $request)
{
$this->validate($request, ['name' => 'required', 'email' => 'required|email', 'website' => 'url']);
$input = $request->all();
$client = Client::create($input);
$client->save();
Session::flash('success', 'Client successfully added.');
return Redirect::route('client.index');
}
示例13: handle
/**
* Handle the command.
*
* @param CreateClientUserCommand $command
* @return void
*/
public function handle(CreateClientUserCommand $command)
{
//If photo uploaded correctly
//Create user and client in DB
DB::transaction(function () use($command) {
$user = User::create(['email' => $command->email, 'password' => $command->password]);
$client = Client::create(['profile_photo' => $command->profile_photo, 'first_name' => $command->first_name, 'last_name' => $command->last_name, 'user_id' => $user->id, 'email' => $command->email, 'phone_1' => $command->phone_1, 'phone_2' => $command->phone_2, 'address_1' => $command->address_1, 'address_2' => $command->address_2, 'city' => $command->city, 'state' => $command->state, 'zip' => $command->zip]);
});
}
示例14: create
function create()
{
$client = array('name' => Input::get('ad'), 'last_name' => Input::get('soyad'), 'email' => Input::get('email'), 'tel' => Input::get('tel'), 'app_date' => Input::get('randevuTarihi'), 'hour_id' => Input::get('saat'), 'message' => Input::get('mesaj'));
$create = Client::create($client);
if ($create) {
$_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:green;">Bilgileriniz alındı en yakın zamanda size döneceğiz.</p></center></div>';
} else {
$_SESSION['mesaj'] = '<div class="form-signin" style="background-color:pink;"><center><p style="color:green;">Hata Oluştu.</p></center></div>';
}
return Redirect::to('e-randevu');
}
示例15: store
public function store(ClientRequest $request)
{
if (Auth::check()) {
$userId = Auth::user()->id;
}
$client = Client::create(['name' => $request['name'], 'creator_user_id' => $userId]);
$userOrganisationRole = UserOrganisationRole::find($userId);
$organisationClient = OrganisationsClients::create(['organisation_id' => $userOrganisationRole->organisation_id, 'client_id' => $client->id]);
$organisationClient->clients()->save($client);
return redirect('clients/create');
}