public function del($id)
 {
     Mailcontent::find($id)->delete();
     return Redirect::to('mailcontents')->withInput()->with('success', '最新消息刪除成功');
 }
Пример #2
0
Route::get('/explode.json', function () {
    $exe = DB::table("explode")->groupBy('created_at')->orderBy("created_at", "desc")->paginate(10);
    echo "<table>";
    foreach ($exe as $row) {
        $dates = DB::table("explode")->where('created_at', $row->created_at)->get();
        echo "<tr><th>" . $row->created_at . "<td>";
        echo "<th>" . count($dates) . "</th></tr>";
    }
    echo "</table>";
});
Route::post('/delImage', function () {
    DB::table("rate_pics")->where('id', Input::get("pic_id"))->delete();
});
//除刪郵件圖片
Route::post('/delMailContentImage', function () {
    $obj = Mailcontent::where('id', Input::get("id"))->first();
    echo $obj->image;
    File::delete(public_path() . $obj->image);
    $obj->image = '';
    $obj->save();
    // ->update(array('image'=>''));
});
Route::get('/downloadImage', "FrontendController@checkPas");
Route::post('/checkRatePas', "FrontendController@checkRatePas");
Route::post('/setDownloadPas', function () {
    // Rate::where('id', Input::get("rate_id"));
    $data = Input::all();
    // print_r($data);
    Rate::where('id', $data['rate_id'])->update(array('secret' => $data['val']));
});
// newsInfo
Пример #3
0
 public function content()
 {
     $data = Input::all();
     // print_r($data);
     // array_push($stack, "mailto", "raspberry");
     $obj = Mailcontent::first();
     // echo $obj->mailto;
     // $data=array_push($data,array( "mailto"=>$obj->mailto));
     //
     // // print_r($data);
     //
     Mail::send('emails.auth.reminder', $data, function ($message) use($obj) {
         // $message->to('*****@*****.**', 'John Smith')->subject('Welcome!');
         $message->from('*****@*****.**', 'withvictor');
         $message->to($obj->mailto);
         // $message->attach($pathToFile);
     });
     //
     //
     return Redirect::to('/contact')->withInput()->with('success', '寄送成功');
 }