コード例 #1
0
 /**
  * Handle the event.
  *
  * @param  UserWasRegistered  $event
  * @return void
  */
 public function handle(UserWasRegistered $event)
 {
     \Mail::raw('A new user just registered', function ($message) {
         $message->from('*****@*****.**', 'RacquetballHub');
         $message->to('*****@*****.**')->subject('New RballHub Registration!');
     });
 }
コード例 #2
0
ファイル: SendSMS.php プロジェクト: PrestonEn/BarbaricWaffle
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(Mailer $mailer)
 {
     Mail::raw('This is a message from Homestead. This message was sent automatically from the queued jobs.', function ($message) {
         $message->from('*****@*****.**', 'Homestead');
         $message->to('*****@*****.**');
         $message->subject('9059310355');
     });
 }
コード例 #3
0
 protected function onCreate(User $user)
 {
     $newAccount = $this->createNewAccountEntry();
     \Mail::raw('A test email sent to ' . $user->name, function ($message) use($user) {
         $message->from('*****@*****.**', 'Laravel');
         $message->to($user->email);
     });
 }
コード例 #4
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     \App\User::created(function ($user) {
         \Mail::raw("Welcome to Wellmet.me!", function ($message) use($user) {
             $message->from("*****@*****.**", "WellMet");
             $message->to($user->email, $user->name);
         });
     });
 }
コード例 #5
0
ファイル: SeparateFileHandler.php プロジェクト: skvn/laraext
 protected function write(array $record)
 {
     $target = \Config::get('laraext.log.main');
     $exception_logs = \Config::get('laraext.log.exceptions');
     if (!empty($record['context']['target'])) {
         $target = "logs/" . $record['context']['target'];
     }
     $class = null;
     if (isset($record['context']['exception'])) {
         $class = class_basename($record['context']['exception']);
         $callbacks = \Config::get('laraext.errors.exception_callbacks');
         if (array_key_exists($class, $exception_logs)) {
             $target = $exception_logs[$class];
         }
         if (array_key_exists($class, $callbacks)) {
             list($cls, $method) = explode('@', $callbacks[$class]);
             $obj = new $cls();
             $obj->{$method}($record['context']['exception']);
         }
     }
     if (strpos($target, '%') !== false) {
         $target = str_replace("%d", date("Ymd"), $target);
     }
     if (!empty($record['context']['browsify'])) {
         $this->logConsole($record['message']);
         return;
     }
     error_log((string) $record['formatted'], 3, storage_path($target));
     if ($mailto = \Config::get('laraext.log.mailto')) {
         if ($only = \Config::get('laraext.log.mailto_only')) {
             if (is_null($class) || !in_array($class, $only)) {
                 return;
             }
         }
         if ($except = \Config::get('laraext.log.mailto_except')) {
             if (is_null($class) || in_array($class, $except)) {
                 return;
             }
         }
         if (!in_array((string) $record['message'], $this->all_exceptions)) {
             \Mail::raw((string) $record['formatted'], function ($message) use($mailto) {
                 foreach (explode(",", $mailto) as $mail) {
                     $message->to($mail);
                 }
                 $subject = \Config::get('laraext.log.mailto_subject');
                 $subject = str_replace('%u', \Config::get('app.url'), $subject);
                 $subject = str_replace('%i', \Config::get('app.instance_name'), $subject);
                 $message->subject($subject);
             });
         }
         $this->last_exception = (string) $record['message'];
         $this->all_exceptions[] = (string) $record['message'];
     }
 }
コード例 #6
0
 /**
  * @param $key \Montopolis\MagicAuth\Models\Key
  */
 public function sendKey($key)
 {
     $mode = config('montopolis_magic_auth.mode');
     $message = view("montopolis_magic_auth::messages.{$mode}", compact('key'));
     $email = $key->email;
     Mail::raw($message, function ($message) use($email) {
         $domain = url('/');
         $parts = explode('://', $domain);
         $message->to($email)->subject('Sign in for ' . $parts[1]);
     });
 }
コード例 #7
0
 public function contactMe(MessageRequest $request)
 {
     $request->input('title');
     $result = \Mail::raw(Input::get('message'), function ($message) {
         $message->to('*****@*****.**', 'Peihui Shao')->subject('Message from ' . Input::get('email') . ', ' . Input::get('user'));
     });
     Message::create($request->all());
     //        flash()->info(        var_dump($result)); //not working
     flash()->success('Your message has been delivered and saved!');
     return Redirect::back();
 }
コード例 #8
0
 /**
  * Sends email
  * @param \Exception                $exception
  * @param  \Illuminate\Http\Request $request
  */
 protected function sendMail($exception, $request)
 {
     $error = $exception->getMessage();
     $current_url = $request->fullUrl();
     $message = sprintf("Url: %s \n\rError: %s \n\rLog: %s", $current_url, $error, (string) $exception);
     \Mail::raw($message, function ($msg) use($current_url) {
         $site = env('CATEGORY');
         $recipients = [env('ADMIN_EMAIL')];
         $msg->subject("{$site} subsite has error - " . $current_url);
         $msg->to($recipients);
         $msg->from(['*****@*****.**']);
     });
 }
コード例 #9
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function condition($id)
 {
     $latest_record = TransformerRecord::where('transformer_id', $id)->latest()->first();
     if (is_null($latest_record)) {
         $status['general'] = 0;
         $status['voltage'] = 'No record';
         $status['current'] = 'No record';
         $status['temperature'] = 'No record';
         $status['oil'] = 'No record';
     } else {
         $status = [];
         if ($latest_record->temperature > 80 || $latest_record->voltage > 420 || $latest_record->current > 20 || $latest_record->oil < 20) {
             $status['general'] = 0;
         } else {
             $status['general'] = 1;
         }
         if ($latest_record->voltage > 420) {
             $status['voltage'] = 'Not ok';
         } else {
             $status['voltage'] = 'ok';
         }
         if ($latest_record->current > 20) {
             $status['current'] = 'Not ok';
         } else {
             $status['current'] = 'ok';
         }
         if ($latest_record->temperature > 80) {
             $status['temperature'] = 'Not ok';
         } else {
             $status['temperature'] = 'ok';
         }
         if ($latest_record->oil < 20) {
             $status['oil'] = 'Not ok';
         } else {
             $status['oil'] = 'ok';
         }
     }
     if ($status['general'] == 0) {
         \Mail::raw('This Transformer has issues and is experiencing faults', function ($message) {
             $message->from('*****@*****.**', 'Transformer Monitoring');
             $message->subject('Transformer Fault Detected');
             $message->to('*****@*****.**')->cc('*****@*****.**');
         });
         try {
             $error = Error::create(['Transformer' => Transformer::find($latest_record->transformer_id)->name, 'Transformer_id' => $latest_record->transformer_id]);
         } catch (\Exception $e) {
         }
     }
     return view('transformers.create', ['record' => $latest_record, 'status' => $status]);
 }
コード例 #10
0
 /**
  * Handle the event.
  *
  * @param  ScheduleResponse  $event
  * @return void
  */
 public function handle(ScheduleResponse $event)
 {
     //
     // if(!$response_templates = ResponseTemplate::where('trigger_event',1)->orderBy('created_at','desc')->get())
     // {
     //     return false;
     // }
     $response_templates = ResponseTemplate::where('trigger_event', 1)->orderBy('created_at', 'desc')->get();
     $contact = Contact::find($event->inquiry->user_id);
     foreach ($response_templates as $t) {
         $this->schedule->create($t, $contact);
     }
     \Mail::raw('Scheduled Responses were created for ' . $contact->fullname, function ($m) {
         $m->to('*****@*****.**', 'Tim Bradshaw')->from('*****@*****.**', 'LTD Sailing')->subject('The Prospect Inquiry Event Handler Fired to Create Scheduled Responses');
     });
 }
コード例 #11
0
 public function contactus_post()
 {
     // ------------------------------------------------------------------------------------------------------------
     // SHOW DISPLAY
     // ------------------------------------------------------------------------------------------------------------
     $rules['name'] = ['required', 'min:3'];
     $rules['email'] = ['required', 'email'];
     $rules['message'] = ['required', 'min:30'];
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return redirect()->back()->withInput()->withErrors($validator);
     } else {
         $data = Input::all();
         Mail::raw(Input::get('message'), function ($m) use($data) {
             $m->to('*****@*****.**', 'CAPCUS')->subject('From Website Contact Us - ' . $data['email']);
         });
         return redirect()->route('web.about.contactus.success');
     }
 }
コード例 #12
0
ファイル: helpers.php プロジェクト: AlexAustralia/printflow
function send_email($from, $replyTo, $to, $bcc, $subject, $body)
{
    Mail::raw($body, function ($message) {
        /*foreach (explode(", ", $input['from']) as $from){
        
                    $pattern = '/(.*?)\<(.*?)\>/';
                    preg_match($pattern, $from, $parts);
                    dd($parts);
                    $message->from($parts[0], $parts[1]);
        
                }
                die($message);
                $message->replyTo('*****@*****.**', 'David Thorne');
                $message->to('*****@*****.**');
                $message->subject($input['subject']);
                $message->bcc('*****@*****.**');*/
        $message->to('*****@*****.**');
        $message->subject($subject);
        $message->bcc('*****@*****.**');
    });
}
コード例 #13
0
 public function form(Request $request)
 {
     $call = null;
     if ($request->isMethod('post')) {
         $call = new CallRequest($request->all());
         $call->remote_ip = $request->ip();
         if ($call->save()) {
             $email = \Config::get('callrequest.notify_email');
             if (!empty($email)) {
                 // Для упрощения отправку сообщения сделаем здесь же, но вообще так лучше не делать :)
                 $message = "Новый заказ звонка с сайта\n";
                 $message .= "Все данные и сообщение";
                 $subject = "Алярма,  новый заказ звонка!";
                 \Mail::raw($message, function ($msg) use($email, $subject) {
                     $msg->to($email);
                     $msg->subject($subject);
                 });
             }
         }
     }
     return view('call-request::form', compact('call'));
 }
コード例 #14
0
 public function testMessagesPerMinute()
 {
     $messages_per_minute = config('mail-throttler.' . config('mail.driver') . '.messages_per_minute');
     if (!$messages_per_minute) {
         $this->markTestSkipped("To run this test you must set messages_per_minute for the driver you are using.  This test should take a full minute to execute and will send the number of messages you have set plus one.");
     }
     $start = time();
     for ($i = 0; $i < $messages_per_minute + 1; ++$i) {
         \Mail::raw('Test Message', function ($message) {
             $message->from('*****@*****.**', 'John Doe');
             $message->sender('*****@*****.**', 'John Doe');
             $message->to('*****@*****.**', 'John Doe');
             $message->cc('*****@*****.**', 'John Doe');
             $message->bcc('*****@*****.**', 'John Doe');
             $message->replyTo('*****@*****.**', 'John Doe');
             $message->subject('Subject');
         });
     }
     $end = time();
     $total_time = $end - $start;
     $this->assertGreaterThanOrEqual(60, $total_time);
 }
コード例 #15
0
 public function failed()
 {
     // Called when the job is failing...
     echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
     $mail = 'Mail body';
     Mail::raw($mail, function ($message) {
         $message->to('*****@*****.**', 'John Smith')->subject('Crawl discontinued: ');
     });
 }
コード例 #16
0
 /**
  * We've hit a snag, so we are gracefully killing ourselves after we contact the admin about it.
  * @return mixed
  */
 protected function exception($rawEmail)
 {
     // This only bounces with config errors or problems with installations where we cannot accept
     // the email at all. In normal cases the bounce will be handled within EmailProcess::()
     Log::error('(JOB ' . getmypid() . ') ' . get_class($this) . ': ' . 'Email receiver is ending with errors. The received e-mail will be bounced to the admin for investigation');
     $sent = Mail::raw('AbuseIO was not able to receive an incoming message. This message is attached to this email.', function ($message) use($rawEmail) {
         $message->from(Config::get('main.notifications.from_address'), 'AbuseIO EmailReceiver');
         $message->to(Config::get('main.emailparser.fallback_mail'));
         $message->attachData($rawEmail, 'failed_message.eml', ['as' => 'failed_message.eml', 'mime' => 'message/rfc822']);
     });
     if (!$sent) {
         Log::error('(JOB ' . getmypid() . ') ' . get_class($this) . ': ' . 'Unable to send out a bounce to ' . Config::get('main.emailparser.fallback_mail'));
     } else {
         Log::info('(JOB ' . getmypid() . ') ' . get_class($this) . ': ' . 'Successfully send out a bounce to ' . Config::get('main.emailparser.fallback_mail'));
     }
 }
コード例 #17
0
ファイル: LogRotateCommand.php プロジェクト: skvn/laraext
 public function handle()
 {
     $removed = [];
     foreach (\Config::get('laraext.logrotate') as $pattern => $rules) {
         if (!file_exists(dirname(storage_path($pattern)))) {
             continue;
         }
         $files = [];
         $dirs = [];
         $list = \File::files(dirname(storage_path($pattern)));
         $dirlist = \File::directories(dirname(storage_path($pattern)));
         foreach ($list as $f) {
             if (preg_match("#^" . str_replace('%d', '\\d+', basename($pattern)) . "\$#", basename($f))) {
                 $files[] = $f;
             }
             if (preg_match("#^" . str_replace('*', '.+', basename($pattern)) . "\$#", basename($f))) {
                 $files[] = $f;
             }
         }
         foreach ($dirlist as $d) {
             if (preg_match("#^" . str_replace('%d', '\\d+', basename($pattern)) . "\$#", basename($d))) {
                 $dirs[] = $d;
             }
             if (preg_match("#^" . str_replace('*', '.+', basename($pattern)) . "\$#", basename($d))) {
                 $dirs[] = $d;
             }
         }
         rsort($files);
         rsort($dirs);
         if (!empty($rules['keep'])) {
             foreach ($files as $ind => $file) {
                 if ($ind < $rules['keep']) {
                     continue;
                 }
                 if (!empty($rules['exclude'])) {
                     if (preg_match('#' . $rules['exclude'] . '#', $file)) {
                         continue;
                     }
                 }
                 if (!empty($rules['exclude_size_gt'])) {
                     if (filesize($file) > $rules['exclude_size_gt'] * 1024 * 1024) {
                         continue;
                     }
                 }
                 unlink($file);
                 $removed[] = $file;
             }
         }
         if (!empty($rules['keep_dir'])) {
             foreach ($dirs as $ind => $dir) {
                 if ($ind < $rules['keep_dir']) {
                     continue;
                 }
                 \File::deleteDirectory($dir);
                 $removed[] = $dir;
             }
         }
     }
     if ($mailto = \Config::get('laraext.log.mailto')) {
         \Mail::raw(implode("\n", $removed), function ($message) use($mailto) {
             foreach (explode(",", $mailto) as $mail) {
                 $message->to($mail);
             }
             $subject = "Logs rotation on %i";
             $subject = str_replace('%u', \Config::get('app.url'), $subject);
             $subject = str_replace('%i', \Config::get('app.instance_name'), $subject);
             $message->subject($subject);
         });
     }
 }
コード例 #18
0
 /**
  * Generic Mail send function
  */
 protected function sendTestMail()
 {
     // MAIL:        Basic
     Mail::raw($this->body, function ($message) {
         $message->to($this->recipient);
         $message->from($this->sender);
         $message->subject($this->subject);
     });
 }
コード例 #19
0
<?php

/*
|--------------------------------------------------------------------------
| アプリケーションのルート
|--------------------------------------------------------------------------
|
| ここでアプリケーションのルートを全て登録することが可能です。
| 簡単です。ただ、Laravelへ対応するURIと、そのURIがリクエスト
| されたときに呼び出されるコントローラーを指定してください。
|
*/
Route::get('/', function () {
    \Mail::raw('本日は晴天なり', function ($message) {
        $message->to('*****@*****.**')->subject('テスト送信');
    });
    return '送信しました。';
});
コード例 #20
0
    public function requestadvice(Request $request)
    {
        $data['user'] = \Auth::user()->name . ' (' . \Auth::user()->email . ')';
        $data['date'] = (new \DateTime())->format('Y-m-d H:i:s');
        $data += $request->except('_token');
        $emailcontent = "<h2>You've received a request for advice:</h2>\n";
        $emailcontent .= "<table>\n";
        foreach ($data as $key => $value) {
            $emailcontent .= <<<CONTENT
<tr>
    <th>{$key}</th>
    <td>{$value}</td>
</tr>

CONTENT;
        }
        $emailcontent .= "</table>";
        \Mail::raw($emailcontent, function ($message) {
            $message->subject('Request for advice')->from('*****@*****.**', 'Sportschool noreply')->replyto(\Auth::user()->email, \Auth::user()->name)->to('*****@*****.**');
        });
        return 'Your request for advice has beent sent.';
    }
コード例 #21
0
ファイル: routes.php プロジェクト: karthik-j/ProfilePage
    $phone = trim(Input::get("phone"));
    if (empty($name)) {
        // 400 (bad request) response code and exit.
        http_response_code(400);
        echo "Oops! There was a problem with your submission for name. Please complete the form and try again.";
        exit;
    }
    if (empty($message)) {
        // 400 (bad request) response code and exit.
        http_response_code(400);
        echo "Oops! There was a problem with your submission for message. Please complete the form and try again.";
        exit;
    }
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        // 400 (bad request) response code and exit.
        http_response_code(400);
        echo "Oops! There was a problem with your submission for email. Please complete the form and try again.";
        exit;
    }
    $recipient = "*****@*****.**";
    $subject = "New contact from {$name}";
    $email_content = "Name: {$name}\n";
    $email_content .= "Email: {$email}\n\n";
    $email_content .= "Phone: {$phone}\n\n";
    $email_content .= "Message:\n{$message}\n";
    Mail::raw($email_content, function ($message1) use($email, $name, $recipient) {
        $message1->from($email, $name);
        $message1->to($recipient)->subject('ProfilePage - Contact!');
        echo "Message sent. Will reach you shortly";
    });
});
コード例 #22
0
 public static function validateVerifyToken($token)
 {
     $user = static::validateToken('verify_token', $token);
     if ($user) {
         $user->verified = true;
         $user->save();
         $_SESSION['user'] = $user;
         $_SESSION['ALERT'] = alert('Success!', 'Your e-mail has been verified. Check out the upcoming events.', 'success');
         // Support Email
         $message = "{$user->first_name} {$user->last_name} has registered with and verified {$user->email}.";
         Mail::raw($message, function ($m) {
             $m->subject("Account Registration");
         });
         // Add to MailChimp
         // $mailchimp = new Guzzle([
         //     'base_uri' => 'https://us3.api.mailchimp.com/3.0/',
         //     'headers' => ['Authorization' => "apikey {$_ENV['MAILCHIMP_APIKEY']}"],
         //     'http_errors' => false
         // ]);
         // $mailchimp->post('lists/0a53d757dd/members', [
         //     'json' => [
         //         'email_address' => $user->email,
         //         'status' => 'subscribed',
         //         'merge_fields' => [
         //             'FNAME' => $user->first_name,
         //             'LNAME' => $user->last_name,
         //             'ZIPCODE' => $user->location,
         //             'STATUS' => 'Enabled'
         //         ],
         //         'interests' => [
         //             '530ac8bd04' => true // Poker
         //         ]
         //     ]
         // ]);
     }
     return redirect('/');
 }
コード例 #23
0
ファイル: routes.php プロジェクト: rhsu0268/Pongo
    if (config('app.debug')) {
        echo "Yes";
    } else {
        echo "No";
    }
    echo '<h1>Database Config</h1>';
    /*
    The following line will output your MySQL credentials.
    Uncomment it only if you're having a hard time connecting to the database and you
    need to confirm your credentials.
    When you're done debugging, comment it back out so you don't accidentally leave it
    running on your live server, making your credentials public.
    */
    //print_r(config('database.connections.mysql'));
    echo '<h1>Test Database Connection</h1>';
    try {
        $results = DB::select('SHOW DATABASES;');
        echo '<strong style="background-color:green; padding:5px;">Connection confirmed</strong>';
        echo "<br><br>Your Databases:<br><br>";
        print_r($results);
    } catch (Exception $e) {
        echo '<strong style="background-color:crimson; padding:5px;">Caught exception: ', $e->getMessage(), "</strong>\n";
    }
    echo '</pre>';
});
Route::get('/mail', function () {
    echo "Testing";
    Mail::raw('Laravel with Mailgun is easy!', function ($message) {
        $message->to('*****@*****.**');
    });
});
コード例 #24
0
ファイル: routes.php プロジェクト: athill/wimf
/*
|--------------------------------------------------------------------------
| 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.
|
*/
Route::get('/', 'HomeController@index');
Route::get('/mailTest', function () {
    // dd(Config::get('mail'));
    Mail::raw('Text to e-mail', function ($message) {
        $message->from('*****@*****.**', 'WIMF');
        $message->subject('email test');
        $message->to('*****@*****.**');
    });
    return 'sent';
});
Route::get('home', 'HomeController@index');
//// same page, but react will render the demo based on url
Route::get('/demo', 'DemoController@index');
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
// =============================================
// API ROUTES ==================================
// =============================================
Route::group(['prefix' => 'api'], function () {
    Route::resource('currentUser', 'CurrentUserController', ['only' => ['index']]);
    Route::group(['middleware' => ['auth']], function () {
        Route::resource('containers', 'ContainerController', array('only' => array('index', 'store', 'destroy', 'update', 'show')));
コード例 #25
0
ファイル: routes.php プロジェクト: bearlikelion/styleasia
                $tags[$product->category] = explode(',', trim($product->tags));
            }
        }
    }
    if (isset($categories)) {
        $categories = array_unique($categories);
    } else {
        $categories = [$category];
        $tags[$category] = [$subcategory];
    }
    return view('products', ['category_name' => $category, 'subcategory_name' => $subcategory, 'categories' => $categories, 'products' => $products, 'tags' => isset($tags) ? $tags : null]);
});
$app->get('/product/{sku}', function ($sku) use($app) {
    $product = DB::table('products')->select('*')->where('sku', '=', $sku)->first();
    $pictures = DB::table('product_images')->select('*')->where('sku', '=', $sku)->get();
    return view('details', ['product' => $product, 'pictures' => $pictures]);
});
$app->post('/contact', function (Illuminate\Http\Request $request) use($app) {
    Mail::raw($request->input('message'), function ($msg) use($request) {
        $msg->to(['*****@*****.**']);
        $msg->from([$request->input('email')]);
        $msg->subject('[Contact Us] ' . $request->input('from') . '<' . $request->input('email') . '>');
    });
    return redirect('/')->with('status', 'Message Sent');
});
$app->get('/about', function () {
    return view('about', ['homepage' => true]);
});
$app->get('/brands', function () {
    return view('brands', ['homepage' => true]);
});
コード例 #26
0
ファイル: routes.php プロジェクト: ronal2do/stq001_bkp
//contatos
Route::post('mensagem', 'MenController@store');
Route::post('news', 'News@store');
//fim do contatos
Route::get('/postagem/{id}', 'PostController@show');
// Painel (ADMIN)
Route::group(['middleware' => 'auth'], function () {
    Route::get('home', function () {
        return view('home');
    });
    Route::get('artigos', 'PostController@index');
    Route::get('cadastrar', 'PostController@create');
    Route::post('cadastrar', 'PostController@store');
    Route::get('postagem/{id}/editar', 'PostController@edit');
    Route::post('postagem/{id}/editar', 'PostController@update');
    Route::get('postagem/{id}/deletar', 'PostController@destroy');
    Route::post('postagem/{id}/deletar', 'PostController@destroy');
    // video
    Route::get('editarvideo', 'VdController@lista');
    Route::get('cadastrarvideo', 'VdController@create');
    Route::post('cadastrarvideo', 'VdController@store');
    Route::get('video/{id}/editar', 'VdController@edit');
    Route::post('video/{id}/editar', 'VdController@update');
    Route::get('video/{id}/deletar', 'VdController@destroy');
    Route::post('video/{id}/deletar', 'VdController@destroy');
});
Route::get('email', function () {
    Mail::raw('Mensagem de teste', function ($m) {
        $m->from('*****@*****.**', 'Laravel')->to('*****@*****.**', 'Sotaque')->subject('#SomosSBC - Nova mensagem');
    });
});
コード例 #27
0
ファイル: routes.php プロジェクト: Elicast/curso-laravel-5.1
});
// Authentication routes...
Route::get('login', 'Auth\\AuthController@getLogin');
Route::post('login', 'Auth\\AuthController@postLogin');
Route::get('logout', 'Auth\\AuthController@getLogout');
// Registration routes...
//Route::get('auth/register', 'Auth\AuthController@getRegister');
//Route::post('auth/register', 'Auth\AuthController@postRegister');
// Password reset link request routes...
//Route::get('recuperar-senha', 'Auth\PasswordController@getEmail');
Route::post('recuperar-senha', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('resetar-senha/{token}', 'Auth\\PasswordController@getReset');
Route::post('resetar-senha/', 'Auth\\PasswordController@postReset');
Route::controller('/', 'Site\\HomeController');
Route::controller('carros', 'CarrosController');
Route::controller('users', 'UserController');
Route::get('sessao/gravar', function () {
    echo "GRAVAR: Gravando sessão";
    session(['msg' => 'Gravando sessão no Laravel!']);
});
Route::get('sessao/exibir', function () {
    $msg = session('msg');
    return $msg;
});
Route::controller('collection', 'CollectionController');
Route::get('email', function () {
    Mail::raw('Mensagem de testo puro', function ($m) {
        $m->to('*****@*****.**', 'João')->subject('Enviando E-mails pelo Laravel');
    });
});
コード例 #28
0
ファイル: routes.php プロジェクト: ronal2do/stq004
});
/**
* API
*/
Route::get('api/users', ['middleware' => 'cors', function () {
    return \Response::json(\App\User::get(), 200);
}]);
Route::get('api/markers', ['middleware' => 'cors', function () {
    return \Response::json(\App\Mark::get(), 200);
}]);
Route::post('api/markers', ['middleware' => 'cors', function () {
    return \Response::json(\App\Mark::get(), 200);
}]);
Route::get('api/contributors', ['middleware' => 'cors', function () {
    return \Response::json(\App\Contributor::get(), 200);
}]);
Route::get('api/posts', ['middleware' => 'cors', function () {
    return \Response::json(\App\Posts::get(), 200);
}]);
Route::get('api/news', ['middleware' => 'cors', function () {
    return \Response::json(\App\Posts::get(), 200);
}]);
Route::post('oauth/access_token', function () {
    return Response::json(Authorizer::issueAccessToken());
});
Route::get('email', function () {
    Mail::raw('Novo voluntário cadastrado', function ($m) {
        $m->to('*****@*****.**', 'Marilia sem Dengue')->bcc('*****@*****.**', 'Marilia sem Dengue')->subject('Novo voluntário cadastrado no site');
    });
    return \Redirect::to('/home');
});
コード例 #29
0
ファイル: routes.php プロジェクト: cookies5127/cookiesblog
    Route::resource('sees', 'SeeController');
    Route::resource('wanteds', 'WantedController');
    Route::resource('repos', 'RepoController');
    Route::resource('pros', 'ProjectController');
    Route::resource('prosword', 'ProjectWordController');
    Route::resource('prosthink', 'ProjectThinkController');
    Route::resource('prosplan', 'ProjectPlanController');
    Route::resource('prosbug', 'ProjectBugController');
    Route::resource('proscheck', 'ProjectCheckController');
    Route::resource('months', 'MonthController');
    Route::resource('schedules', 'ScheduleController');
    Route::resource('todos', 'TodolistController');
    Route::resource('thinks', 'ThinkController');
    Route::resource('cates', 'CategoryController');
    Route::resource('notes', 'NotebookController');
    Route::post('info', function () {
        $data = Input::get('data');
        Mail::raw($data['content'], function ($m) use($data) {
            $m->from($data['email'], $data['name']);
            $m->to('*****@*****.**');
            $m->subject($data['name']);
        });
        return response()->json($data);
    });
});
Route::when('auth/*', 'csrf', ['post', 'delete', 'put']);
Route::group(['prefix' => 'auth'], function () {
    $Auth = 'Auth\\AuthController@';
    Route::get('logout', ['as' => 'logout', 'uses' => $Auth . 'getLogout']);
    Route::post('login', $Auth . 'postLogin');
});