本文整理汇总了PHP中app\Contact类的典型用法代码示例。如果您正苦于以下问题:PHP Contact类的具体用法?PHP Contact怎么用?PHP Contact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Contact类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: handleProviderCallback
/**
* Obtain the user information from GitHub.
*
* @return Response
*/
public function handleProviderCallback()
{
$socialiteUser = Socialite::driver('github')->user();
//If the org filter is set get the users organisations and check them
if (!empty(env('VALID_GITHUB_ORG'))) {
$this->github->authenticate(\Github\Client::AUTH_URL_TOKEN, $socialiteUser->token);
$organizations = $this->github->currentUser()->memberships()->all();
$loginValid = false;
foreach ($organizations as $org) {
if ($org['organization']['login'] === env('VALID_GITHUB_ORG')) {
$loginValid = true;
}
}
if (!$loginValid) {
return redirect('/login')->withError('Not a member of the required organisation');
}
}
//Locate a user or create an account
$user = User::where('email', $socialiteUser->getEmail())->first();
if (!$user) {
$user = User::create(['email' => $socialiteUser->getEmail(), 'name' => $socialiteUser->getName()]);
//Add a contact record for the user so they receive update notifications
$contact = new Contact();
$contact->name = $user->name;
$contact->email = $user->email;
$contact->filter_tags = [];
$contact->active = true;
$contact->save();
}
Auth::login($user, true);
return redirect('/pings');
}
开发者ID:vestd,项目名称:ProcessMonitor,代码行数:37,代码来源:GitHubController.php
示例2: store
public function store(Request $request)
{
// Validation
$this->validate($request, ['email' => 'required', 'message' => 'required|between:20,300']);
$contact = new Contact($request->all());
$contact->save();
// return $request->all();
return redirect('contact');
}
开发者ID:tiggerbaby,项目名称:testing-laravel,代码行数:9,代码来源:ContactController.php
示例3: 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|max:255']);
$contact = new Contact();
$contact->name = $request->name;
$contact->save();
$id = $contact->id;
return redirect('/contacts/' . $id);
}
开发者ID:roblesterjr04,项目名称:project-crm,代码行数:16,代码来源:ContactsController.php
示例4: store
public function store(Requests\ContactRequest $request)
{
$contact = new Contact();
$contact->name = $request::get('name');
$contact->name = $request::get('phone_num');
$contact->email = $request::get('email');
$contact->message = $request::get('description');
$contact->save();
return \Redirect::back()->with('message', 'Your request has been submitted successfully. We will get back to you soon');
}
开发者ID:pius-ng3a,项目名称:go_orderdeliver,代码行数:10,代码来源:ContactController.php
示例5: sendMessage
/**
* Fungsi untuk Pengiriman data setelah user mengirimknan pesan
*/
public function sendMessage(Request $request)
{
$contact = new Contact();
$contact->name = $request->get('name');
$contact->phone = $request->get('phone');
$contact->email = $request->get('email');
$contact->message = $request->get('message');
$contact->save();
Session::flash('send', 'Data Berhasil di kirim');
return Redirect('/contactUs');
}
开发者ID:semmiverian,项目名称:webJok,代码行数:14,代码来源:frontEndController.php
示例6: postContactUs
public function postContactUs(ContactPostRequest $request)
{
// dd($request->name);
$contact_us = new Contact();
$contact_us->name = $request->name;
$contact_us->email = $request->email;
$contact_us->subject = $request->subject;
$contact_us->message = $request->message;
$contact_us->save();
return redirect($this->curYear . '/introduction/contact-us')->with('success', 'Pesan anda telah terkirim.');
}
开发者ID:kevinjon27,项目名称:lazato,代码行数:11,代码来源:IntroductionController.php
示例7: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $request)
{
$contact = new Contact($request->all());
$contact->save();
$name = $request->name;
$email = $request->email;
$message = $request->message;
$technology = $request->technology;
$industry = $request->industry;
$this->sendConfirmation($name, $email, $technology, $industry, $message);
return redirect('/contact')->with('success', 'Message successfully submitted');
}
开发者ID:sreekanthmk,项目名称:acknotech-website,代码行数:17,代码来源:ContactController.php
示例8: store
public function store(ContactMeRequest $request)
{
$data = ['name' => $request->get('name'), 'email' => $request->get('email'), 'phone' => $request->get('phone'), 'message' => $request->get('message')];
$contacts = new Contact($data);
$contacts->save();
$data = ['name' => $request->get('name'), 'email' => $request->get('email'), 'phone' => $request->get('phone'), 'msg' => $request->get('message')];
Mail::send('contact/email_template', $data, function ($message) {
$message->from(Input::get('email'), 'Mail from contact page');
$message->to('[email protected]')->subject("message from " . Input::get('name'));
$message->replyTo(Input::get('email'), Input::get('name'));
});
return redirect('contact')->withStatus('We will get back to you soon');
}
开发者ID:polodev,项目名称:Bard-Ftfl-Laravel-Project,代码行数:13,代码来源:ContactController.php
示例9: sendContact
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function sendContact(Request $request)
{
$email = \StringHelper::filterString($request->input('email'));
$name = \StringHelper::filterString($request->input('name'));
$content = \StringHelper::filterString($request->input('comments'));
if ($email != "" && $name != "" && $content != "") {
$contact = new Contact();
$contact->contact_name = $name;
$contact->contact_email = $email;
$contact->contact_content = $content;
$contact->save();
}
return Redirect::back()->with('message', 'Success');
}
开发者ID:huynt57,项目名称:savvy-restaurant,代码行数:19,代码来源:ContactController.php
示例10: store
/**
* Добавить контакт
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$contact = new \App\Contact($input = $request->input());
$validator = \Validator::make($contact->getAttributes(), $rules = self::getValidatorRules());
if ($validator->fails()) {
$this->throwValidationException($request, $validator);
}
$contact->created_by = \Auth::getUser()->id;
$contact->save();
Flash::success('Контакт успешно добавлен');
if (isset($input['add_new'])) {
return redirect(route('contact.create'));
}
return redirect(route('contact.show', $contact));
}
开发者ID:errogaht,项目名称:bv-table,代码行数:21,代码来源:ContactController.php
示例11: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$contacts = Contact::orderBy('id', 'desc')->paginate(10);
$option = Option::findOrFail(1);
$featured_properties = Property::where('Heat_inc', '=', 'Yes')->get();
return view('home', ['contacts' => $contacts, 'option' => $option, 'featured_properties' => $featured_properties]);
}
开发者ID:arjunadotfusion,项目名称:laravelformin,代码行数:12,代码来源:HomeController.php
示例12: destroy
public function destroy(Request $request, $id)
{
$contact = Contact::find($id);
$contact->delete();
$request->session()->flash('alert-success', 'Message has been deleted successfully !');
return redirect('/message')->withInput();
}
开发者ID:sopnopriyo,项目名称:sopnopriyo,代码行数:7,代码来源:ContactController.php
示例13: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$contact = Contact::findOrFail($id);
$contact->delete();
Session::flash('message', 'Successfully Deleted your Data!');
return redirect()->back();
}
开发者ID:minhajCSE,项目名称:teleaus-dev,代码行数:13,代码来源:FeedbackController.php
示例14: boot
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
Contact::updating(function (Contact $contact) {
if ($new_values = $contact->getDirty()) {
if (isset($new_values['status'])) {
$message = \Lang::get('contact.status_update.' . $new_values['status']);
if ($contact->hasAttribute('change_status_comment')) {
if ($comment = $contact->getAttribute('change_status_comment')) {
$message .= PHP_EOL . $comment;
}
unset($contact->change_status_comment);
}
} else {
$values = [];
$old_values = $contact->getOriginal();
foreach ($new_values as $key => $value) {
$values[] = [$key, $old_values[$key], $value];
}
$message = 'json:' . json_encode($values);
}
$log = new ContactLog();
$log->contact_id = $contact->id;
$log->user_id = \Auth::getUser()->id;
$log->comment = $message;
$log->save();
}
});
}
开发者ID:errogaht,项目名称:bv-table,代码行数:35,代码来源:EventServiceProvider.php
示例15: sendContact
/**
* Procesa el formulario de contacto
*
* @param ContactRequest $request
* @return \Illuminate\Http\RedirectResponse
*/
public function sendContact(ContactRequest $request)
{
$contacto = Contact::create($request->all());
event(new ContactFormHasSent($contacto));
Flash::success('Mensaje enviado de manera correcta');
return redirect()->back();
}
开发者ID:JuaninTorres,项目名称:openagora-web,代码行数:13,代码来源:ContactController.php
示例16: SaveLinks
public function SaveLinks($id, Request $request)
{
$member = Member::find($id);
$member->website = $request->get('website');
$member->facebook = $request->get('facebook', null);
$member->twitter = $request->get('twitter', null);
$member->google_plus = $request->get('google_plus', null);
$member->save();
$contact = new Contact();
$contact->name = $request->get('name');
$contact->phone = $request->get('phone');
$contact->email = $request->get('email');
$contact->member_id = $member->id;
$request->address = $request->get('address');
$contact->save();
return redirect()->route('members.projects', $member->id);
}
开发者ID:bikundo,项目名称:members,代码行数:17,代码来源:MembersController.php
示例17: run
public function run()
{
$contacts = Contact::all();
$campaign = Campaign::where('name', '=', 'Halloween Video')->first();
foreach ($contacts as $contact) {
Email::create(['send_on' => Carbon::now()->addMinutes(5), 'template' => 'emails.halloween', 'subject' => 'Happy Halloween!', 'draft' => false, 'campaign_id' => $campaign->id, 'contact_id' => $contact->id]);
}
}
开发者ID:sethphillips,项目名称:event_mailer,代码行数:8,代码来源:DatabaseSeeder.php
示例18: existContact
/**
* Show us the contacts filtered by customers and name
*/
public function existContact()
{
$filterId = Input::get('customerId');
$filter = Input::get('name');
$filter = ['customer_id' => $filterId, 'name' => $filter];
$result = Contact::where($filter)->limit(1)->get(['id']);
return Response::json(array('exist' => $result->count() > 0));
}
开发者ID:programadorjff,项目名称:ioltest,代码行数:11,代码来源:ContactController.php
示例19: stroemessage
public function stroemessage()
{
if (Contact::create(Input::all())) {
return Redirect::back()->withErros(Null);
} else {
return Redirect::back()->withErros('Store fail!');
}
}
开发者ID:luowc302,项目名称:SelfProject,代码行数:8,代码来源:HomeController.php
示例20: destroyContact
function destroyContact()
{
$destroy = Contact::destroy(Input::get('id'));
if ($destroy) {
return '<p style="color: green">Mesaj silindi</p>';
} else {
return '<p style="color: red">Mesaj silinmedi</p>';
}
}
开发者ID:ufukpalavar52,项目名称:laravel-php-projelerim,代码行数:9,代码来源:ContactsController.php
注:本文中的app\Contact类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论