splimter
3/18/2020 - 10:32 AM

usefull snippets

  • get current url
$url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
  • shorhands
Student::where('id', user()->id)
        ->update(['Project_id'=>$request->id]);
// DB::select(
//    'update students
//     set Project_id = ?
//     where id = ?',
//  [$request->id, user()->id]);