123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Http\Controllers\User;
- use Illuminate\Http\Request;
- use App\Http\Requests;
- use App\Http\Controllers\Controller;
- use App\User;
- use App\Models\Note;
- use Auth;
- class UserController extends Controller
- {
- public function index(){
- return "profile";
- }
- public function group(){
- return "group";
- }
- public function add_note(Request $req)
- {
- $note = $req->note;
- $date_time = $req->date_time;
- $sav = new Note;
- $sav->note = $note;
- $sav->user_id = Auth::user()->id;
- $sav->time = $date_time;
- $sav->save();
- return redirect()->back();
- }
- public function change_note_status($id){
- $ch = Note::find($id);
- if($ch->status == 1){
- $ch->status = 0;
- }
- else{
- $ch->status = 1;
- }
- $ch->save();
- return redirect()->back();
- }
- public function remove_note($id){
- $del = Note::find($id)->delete();
- return redirect()->back();
- }
- }
|