コード例 #1
0
 public function index(Request $request)
 {
     if ($request->wantsJson()) {
         return Contact::all();
     }
     return view('template');
 }
コード例 #2
0
 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]);
     }
 }
コード例 #3
0
 function showMessages()
 {
     if (isset($_SESSION['authorization']) && $_SESSION['authorization'] == 1) {
         $contacts = Contact::all();
         return view('users.lookContacts', ['contacts' => $contacts]);
     } else {
         return Redirect::to('./sayfa-bulunamadi');
     }
 }
コード例 #4
0
 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]);
 }
コード例 #5
0
 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) {
         }
     }
 }
コード例 #6
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     // $contact = new Contact;
     // $contact->fullName = 'Piyush Chauhan';
     // $contact->email = '*****@*****.**';
     // $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);
 }
コード例 #7
0
 /**
  * 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'));
 }
コード例 #8
0
 /**
  * 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');
 }
コード例 #9
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contacts = Contact::all();
     return view('ContactBootstrap', compact('contacts'));
 }
コード例 #10
0
 /**
  * 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');
 }
コード例 #11
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contacts = Contact::all();
     return view('ContactMaterialize', compact('contacts'));
 }
コード例 #12
0
 public function getContact()
 {
     return view('store.contact')->with('contacts', Contact::all());
 }
コード例 #13
0
 public function contact()
 {
     $contact_model = Contact::all();
     return view('main.contact', ['model' => $contact_model]);
 }
コード例 #14
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contacts = Contact::all();
     return view('admin.contacts', compact('contacts'));
 }
コード例 #15
0
 /**
  * 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());
 }
コード例 #16
0
<?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();
});
コード例 #17
0
 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;
 }
コード例 #18
0
 public function index()
 {
     $contacts = Contact::all();
     return view('tries.contacts.index', compact('contacts'));
 }
コード例 #19
0
 public function showContactMessage()
 {
     return view('superadmin.showcontact')->with('items', \App\Contact::all());
 }
コード例 #20
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contacts = Contact::all();
     return view('contacts.index')->withContacts($contacts);
 }
コード例 #21
0
 /**
  * Список
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('contact/index')->with(['page_title' => 'Контакты', 'contacts' => \App\Contact::all()->sortByDesc('created_at')]);
 }
コード例 #22
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $contact = Contact::all();
     return view('contact.index')->with('contact', $contact);
 }
コード例 #23
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = ['title' => 'Teleaus Admin Dashboard | All Feedback ', 'allFeedback' => Contact::all()];
     return view('dashboard.allFeedback')->with($data);
 }
コード例 #24
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $contacts = Contact::all();
     return view('contacts.index', ['title' => 'All Contacts', 'contacts' => $contacts]);
 }