当前位置: 首页>>代码示例>>PHP>>正文


PHP Contact::all方法代码示例

本文整理汇总了PHP中app\Contact::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::all方法的具体用法?PHP Contact::all怎么用?PHP Contact::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\Contact的用法示例。


在下文中一共展示了Contact::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index(Request $request)
 {
     if ($request->wantsJson()) {
         return Contact::all();
     }
     return view('template');
 }
开发者ID:vestd,项目名称:ProcessMonitor,代码行数:7,代码来源:ContactController.php

示例2: 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

示例3: showMessages

 function showMessages()
 {
     if (isset($_SESSION['authorization']) && $_SESSION['authorization'] == 1) {
         $contacts = Contact::all();
         return view('users.lookContacts', ['contacts' => $contacts]);
     } else {
         return Redirect::to('./sayfa-bulunamadi');
     }
 }
开发者ID:ufukpalavar52,项目名称:laravel-php-projelerim,代码行数:9,代码来源:ContactsController.php

示例4: __construct

 public function __construct()
 {
     $templates = Touch::all()->each(function ($touch) {
         $client = $touch->campaign->client->name;
         $campaign = $touch->campaign->name;
         $title = $touch->title;
         $touch->myValue = "{$client} | {$campaign} | {$title}";
     })->lists('myValue', 'id')->sort();
     $contactFields = array_keys(Contact::all()->first()->toArray());
     view()->share(['templates' => $templates, 'contactFields' => $contactFields]);
 }
开发者ID:sethphillips,项目名称:event_mailer,代码行数:11,代码来源:TouchesController.php

示例5: run

 public function run()
 {
     $contacts = \App\Contact::all();
     $companies = \App\Company::all();
     for ($i = 0; $i < 20; $i++) {
         try {
             $contacts->random()->companies()->attach($companies->random());
         } catch (\Exception $e) {
         }
     }
 }
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:11,代码来源:CompanyContactSeeder.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     // $contact = new Contact;
     // $contact->fullName = 'Piyush Chauhan';
     // $contact->email = 'piyushchauhan2011@gmail.com';
     // $contact->role = 'Teacher';
     // $contact->schoolName = 'University of Sydney';
     // $contact->message = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
     // $contact->save();
     $contacts = Contact::all();
     return response()->json($contacts);
 }
开发者ID:piyushchauhan2011,项目名称:clickview-test,代码行数:18,代码来源:ContactController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contacts = Contact::all();
     //        [
     //            ['Blog(coming soon)',''],
     //            ['Facebook','https://www.facebook.com/#/Rainlonely'],
     //            ['Twitter','https://twitter.com/rainwr'],
     //            ['Github','https://github.com/Rainlonely'],
     //            ['G+','https://plus.google.com/u/0/+RainWu'],
     //            ['Weibo','http://weibo.com/rainlonely'],
     //            ['Linkedin','https://cn.linkedin.com/in/rain-wu-56523824']
     //        ];
     return view('contact', compact('contacts'));
 }
开发者ID:Rainlonely,项目名称:rainlonely,代码行数:19,代码来源:ContactController.php

示例8: makeExcel

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function makeExcel()
 {
     Excel::create('Company List', function ($excel) {
         $excel->sheet('companies', function ($sheet) {
             $data = Contact::all();
             $data = json_decode(json_encode($data), true);
             $companies = [];
             foreach ($data as $key => $value) {
                 $company['Company'] = $value['company'];
                 $company['Sector'] = $value['sector'];
                 $company['Contact Person'] = $value['contact_person'];
                 $company['Email'] = $value['email'];
                 $company['Phone No'] = $value['phone_no'];
                 $company['Location'] = $value['location'];
                 $companies[] = $company;
             }
             $sheet->fromArray($companies);
         });
     })->download('xlsx');
 }
开发者ID:njugunanduati,项目名称:contact_list,代码行数:26,代码来源:ContactController.php

示例9: saveEmail

 /**
  * Fungsi untuk Save reply yang admin kirim
  * @param int $id
  */
 public function saveEmail(Request $request)
 {
     $testing = Contact::latest()->first();
     $pesan = new Pesan();
     $pesan->email = $request->get('email');
     $pesan->name = $request->get('name');
     $pesan->message = $request->get('message');
     $pesan->save();
     $reply = Pesan::latest()->first();
     Mail::send('emails.reply', ['reply' => $reply], function ($message) use($reply) {
         $message->to($reply->email)->subject('Membalas Pertanyaan Anda');
     });
     $user = Auth::user();
     $contact = Contact::all();
     $count = DB::table('pesans')->count();
     $count2 = DB::table('contacts')->count();
     return Redirect('admin')->with('user', 'contact', 'count', 'count2');
 }
开发者ID:semmiverian,项目名称:webJok,代码行数:22,代码来源:adminController.php

示例10: getContact

 public function getContact()
 {
     return view('store.contact')->with('contacts', Contact::all());
 }
开发者ID:alongmuaz,项目名称:laravel-fyp-cart,代码行数:4,代码来源:StoreController.php

示例11: contact

 public function contact()
 {
     $contact_model = Contact::all();
     return view('main.contact', ['model' => $contact_model]);
 }
开发者ID:bogdantarasenko,项目名称:portfolio,代码行数:5,代码来源:MainController.php

示例12: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $contact = Contact::find($id);
     $contact->delete();
     return json_encode(Contact::all());
 }
开发者ID:PavelSobchenko,项目名称:study_backbone,代码行数:12,代码来源:ContactsController.php

示例13: function

<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use App\Contact;
Route::get('/', function () {
    $isInstall = Schema::hasTable('contacts');
    if (!$isInstall) {
        Artisan::call('migrate', ['--force' => true]);
        Artisan::call('db:seed', ['--force' => true]);
    }
    $contacts = Contact::all();
    return view('contacts')->with('contacts', $contacts);
});
Route::post('/', function () {
    Contact::create(Input::all());
    return back();
});
Route::get('/{id}/delete', function ($id) {
    $contact = Contact::find($id);
    $contact->delete();
    return back();
});
开发者ID:higlen,项目名称:php-laravel-mysql-sample,代码行数:31,代码来源:routes.php

示例14: AdminDownloadCsv

 public function AdminDownloadCsv()
 {
     // output headers so that the file is downloaded rather than displayed
     header('Content-Type: text/csv; charset=utf-8');
     header('Content-Disposition: attachment; filename=data.csv');
     // create a file pointer connected to the output stream
     $output = fopen('php://output', 'w');
     // output the column headings
     fputcsv($output, array('Network', 'Name', 'Screen Name'));
     $allcontact = Contact::all();
     foreach ($allcontact as $key => $value) {
         $row = array('network' => $value['network'], 'name' => $value['name'], 'screen_name' => $value['screen_name']);
         fputcsv($output, $row);
     }
     die;
 }
开发者ID:MirzaObaidSE,项目名称:market_mania,代码行数:16,代码来源:AdminController.php

示例15: index

 public function index()
 {
     $contacts = Contact::all();
     return view('tries.contacts.index', compact('contacts'));
 }
开发者ID:knowgod,项目名称:laravel-doctrine,代码行数:5,代码来源:ContactsController.php


注:本文中的app\Contact::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。