當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。