Deekshith

Deekshith

Member Since 1 Year Ago

Experience Points
2,670
Total
Experience

2,330 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
7
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
2,670 XP
Jun
16
1 month ago
Activity icon

Replied to Performance Improvement In Laravel Online MCQ Test Application

@m7vm7v browser cache means local storage? i should store question_id with answer for all 100 questions

Jun
15
1 month ago
Activity icon

Started a new Conversation Performance Improvement In Laravel Online MCQ Test Application

Hello,

I have an online exam application (MCQ type questions) i have questions table and user_answers table and every test will have 100 questions right now i am using this approach,

at first i have created user_answers table and when user click on question options as answer i am storing question_id, user_answer and time taken in table and if user changes the option i am using update query to update the answer so i am doing like this for all 100 questions so when user clicks end exam i am just changing the user_test column status as complete. this is working fine for below 500 users at a time. but when it reaches more than 1000 users at a time then it is giving I/0 problem. is this correct way or any performance tweaks that can be done?

Please help me with this.

Jun
03
2 months ago
Activity icon

Replied to Restrict Laravel Vimeo Livestream Url Only For One User At A Time.

i found some issue in manual way. can you please paste any code if you have, to use logout from other devices without passing password and also i am using laravel 5.5 version. logoutfromotherdevices function came from 5.6 version.

Activity icon

Replied to Restrict Laravel Vimeo Livestream Url Only For One User At A Time.

@bugsysha i have got one solution whenever he goes to video url i will store session id and user_id in one table so if another user loggs in and goes to same url then another device data (session id and user_id) will be stored again so during livestream i will do ajax call to check if user_id and with different session id exists then i will logout and delete corresponding entry from that table.

Activity icon

Replied to Restrict Laravel Vimeo Livestream Url Only For One User At A Time.

@bugsysha but the problem is i have a db without password too (Users used google or faebook login). how can i overcome this situation?

Activity icon

Replied to Restrict Laravel Vimeo Livestream Url Only For One User At A Time.

@bugsysha but this requires one time refresh right?

Activity icon

Started a new Conversation Restrict Laravel Vimeo Livestream Url Only For One User At A Time.

I have implemented vimeoe livestream in authenticated route of laravel and now what if someone shared his credentials to other users so i should avoid this is there any way to give permission only for one user at time? can i do something in db level by setting flag? just like netflix only one user can watch that live strram in our paid user dashboard.

Apr
24
3 months ago
Activity icon

Started a new Conversation Store Vimeo Video View Progress And Complete Lesson Status

Hi I am developing online classes web portal where i am using vimeo private videos as video classes. so my requirement is when user logs in to his account and views the video i want to store the video view progress in percentage and i don't want this to store for every second i want to call ajax post for every 5 % percent of video view (5,0,15% like this).

And also i should restrict a user only for 2 views what logic shall i use? there will be three cases

  1. User starts the video and completes (Which can be done)
  2. what if a user plays a video and closes the window and again plays that video?
  3. What if user plays that video and completes and again re watches that video without page refresh?

Below is my code

const TOLERANCE = 0.002;

player.on('timeupdate', function(data) {

  var currentTime = data.percent;
  var multiplyData = 100;
  var finalData = (currentTime*100);


  
    
  if (data.percent == (value - TOLERANCE) || data.percent == (value + TOLERANCE)) {
  
  

  $.ajax({
            url : "{{ url('post-video-percent') }}/{{ $slug }}",
            data : {
                "_token": "{{ csrf_token() }}",
                "percentdata" : finalData, },
            dataType : "post",
            type: "post",
            success: function(response){
                //console.log(response);
                var data = jQuery.parseJSON( response );
                if(data.status == 200) {
                console.log('**** video watching.. all the best for the exams.*****');

                } else if(data.status == 600) {

                  
                  window.location.href="{{ url('user-login') }}";
                
                } else {

                  alert(data.info);
                  window.location.reload();

                }
            }
        });

  } 

 

  
  });

My controller code =>

      $checkVideo = VideoHistory::where('topic_id',$videoDet->id)
                            ->where('user_id',Auth::user()->user_id)
                            ->orderBy('id','DESC')
                            ->first();

      if($checkVideo) 
{

        if($checkVideo->percent <= 90) 
  {

        $history = VideoHistory::where('topic_id',$videoDet->id)
                            ->where('user_id',Auth::user()->user_id)
                            ->orderBy('id','DESC')
                            ->first();
        $history->percent = $request->percentdata;

       } else
     {

        $history = new VideoHistory;
        $history->user_id = Auth::user()->user_id;
        $history->topic_id = $videoDet->id;
        $history->percent = $request->percentdata;

       }

        
      } else 
   {

        $history = new VideoHistory;
        $history->user_id = Auth::user()->user_id;
        $history->topic_id = $videoDet->id;
        $history->percent = $request->percentdata;
      }

      
      

      if($history->save()) 
     {

        return json_encode(array('status'=>200,'info'=>'Data updated successfully.'));
      }

Please help me out.

Apr
21
3 months ago
Activity icon

Started a new Conversation Laravel Logout From All Devices

Hi,

I am implementing a feature like if user tries to login from one device then old logged in sessions should logged out from all other devices except his current device. for this i am using laravel default logout from all devices feature by uncommenting in kernel.php. but my requirement is it logs out only when the user refreshes the page but i want this real time i mean if same user account gets logged in another devices then old device user should get an alert like logging out.

Apr
17
3 months ago
Activity icon

Started a new Conversation Laravel Relations With Count

Hi , I have tables with below table structure

UserTest Model with columns names (user_test_id(primary), test_id, marks_scored,status) Question model with column names (question_id (primary), test_id, question_text,correct_option) UserAnswer model with column names (user_answer_id (primary) , user_test_id (foreign), user_answer, question_id)

i have three requirement to get total questions in a particular usertest and total attempted, correct and incorrect questions in single query using relationship,

right now i am using below query to display total attended questions,

$user_tests_det = UserTest::withCount(['answers as totalattempt' => function($query) {

                           $query->select(DB::raw('count(user_answers.user_answers_auto_id)'));

                        }])->where('user_id',$user_id)->where('user_test_id',$data['user_test_id'])->first();

above query returns correct answer for total attempted questions

my three models are,

UserTest.php

public function answers() {

return $this->hasMany('App\UserAnswer','user_test_id','user_test_id');

} UserAnswer.php

public function questionsbaselist() { return $this->belongsTo(Question::class,'question_id','question_id'); }

public function questionslist() { return $this->questionsbaselist()->where('questions.correct_option','=','user_answers.user_answer'); } I want to display correct answers count which matches user answers user answer and questions correct option (user_answers.user_answer = questions.correct_option) And also the count of inncorrect attempt (user_answers.user_answer != questions.correct_option)

Please help me out as i tried with all ways and not getting this.

Activity icon

Started a new Conversation Laravel Relationship Count Query

Hi , I have tables with below table structure

UserTest Model with columns names (user_test_id(primary), test_id, marks_scored,status) Question model with column names (question_id (primary), test_id, question_text,correct_option) UserAnswer model with column names (user_answer_id (primary) , user_test_id (foreign), user_answer, question_id)

i have three requirement to get total questions in a particular usertest and total attempted, correct and incorrect questions in single query using relationship,

right now i am using below query to display total attended questions,

$user_tests_det = UserTest::withCount(['answers as totalattempt' => function($query) {

                               $query->select(DB::raw('count(user_answers.user_answers_auto_id)'));

                            }])->where('user_id',$user_id)->where('user_test_id',$data['user_test_id'])->first();

above query returns correct answer for total attempted questions

my three models are,

UserTest.php

public function answers() {

    return $this->hasMany('App\UserAnswer','user_test_id','user_test_id');
}

UserAnswer.php

public function questionsbaselist() { return $this->belongsTo(Question::class,'question_id','question_id'); }

public function questionslist()
{
    return $this->questionsbaselist()->where('questions.correct_option','=','user_answers.user_answer');
}

I want to display correct answers count which matches user answers user answer and questions correct option (user_answers.user_answer = questions.correct_option) And also the count of inncorrect attempt (user_answers.user_answer != questions.correct_option)

Please help me out as i tried with all ways and not getting this.

Apr
15
3 months ago
Activity icon

Started a new Conversation Hide The Vimeo Cdn Url In Video Src Tag

Hi i am using vimeo pro account to host videos and embedded to my laravel website using player.js and when we inspect the element and finds out video tag in src parameter it should show the blob url an it is working in other vimeo integrated websites (example check laracasts videos it is showing blob url as src and in network it is showing as chunks / segments instead of direct mp4 file) but when i checked my video src it is directly showing the cdn url where we can copy that url and can download. sometimes it shows blob url and some times it shows akamai cdn url. please help me out i want to display blob url everytime in video tag src

Apr
13
3 months ago
Activity icon

Started a new Conversation Alert And Refresh The Page Automatically On Login From Other Devices

Hello, I have used laravel built in function Auth::logoutOtherDevices($request->password); to logout from all other devices when user loged in using new device. but this works only when other device user refresh the page manually but i need page to be refreshed automatically once user logged in using new device without using pusher or firebase?

Apr
07
4 months ago
Activity icon

Replied to Setting Up Vimeo And Video.js In My View

@mcprogramming Did you achieve this?

@jeffreyway is there any way to achieve more security with vimeo? i did domain whitelisting and if logged in user copies the iframe code and paste it in same website home page then he can directly view that iframe video without being logged in user.

Apr
06
4 months ago
Activity icon

Replied to Use Vimeo Only For Authenticated Users?

@elenktik Actually the problem is if i am a paid user i can able to view the video and someone inspects the web page and copy the iframe and he can play same iframe in our website home page as vimeo domain whitelisting only works for parent domain. i have one solution for this providing temporary url for vimeo video url just like creating temporary url in server end that is using laravel?

Apr
01
4 months ago
Activity icon

Started a new Conversation Use Vimeo For Only Authenticated Users

Hey, I uploaded a video to Vimeo and checked " hide video from Vimeo". I also whitelisted my domain. The video can now only be watched if it is embed on my website.

However, how I can make sure that only authorized users may watch it? Currently, anyone who visits my website and simply by using the browser-inspector tool and copy/paste an iframe in any page of my whitelisted website. Is there a way to make sure a user is authenticated before showing the video?

Activity icon

Replied to Use Vimeo Only For Authenticated Users?

@elenktik i am also facing same issue. if you have found the solution can you please share?

Mar
09
5 months ago
Activity icon

Replied to Laravel Multiply 1000 For Existing Casted Datetime Columns

is there any way to create data structure like below by = looping over below data so that I will convert datetime to unix timestamp multiplied by 1000 using php strtotime function.

"movies": [ { "id": 638, "show": "Morning", "movie_name": "Movie Name", "language": "6", "type": "2D", "censor": "UA", "genre": "Drama", "movie_image": "1580386409.jpg", "status": "1", "timings": "147", "created_at": 1580386409, "updated_at": 1580386409, "screens": [ { "start_time": 1583739600, "movie_id": "638", "screen_id": "Screen-1", "endtime": 1583746620, "id": 8027 }, { "start_time": 1583750100, "movie_id": "638", "screen_id": "Screen-2", "endtime": 1583757120, "id": 8159 }, { "start_time": 1583771100, "movie_id": "638", "screen_id": "Screen-2", "endtime": 1583778120, "id": 8165 } ], "language_details": { "id": 6, "language_name": "Kannada" } }, ];

Activity icon

Replied to Laravel Multiply 1000 For Existing Casted Datetime Columns

It is not working for larval 5.4 as it is showing make: resource not defined. any way we could multiply static number directly in DB:: raw?

Activity icon

Replied to Laravel Multiply 1000 For Existing Casted Datetime Columns

if I do this in client end I have to push updates for users as this is already in app or play store

Activity icon

Started a new Conversation Laravel Multiply 1000 For Existing Casted Datetime Columns

Hello All, I have database with column name start_time which has value like "2020-03-09 13:10:00" Now i am developing an API for ios where it requires to convert this DateTime to UNIX Timestamp. for this, i have written code like below in modal,

protected $casts = [ 'start_time' => 'timestamp', ];

Now i want to multiply 1000 for this start_time columns to make it compatible with IOS. i can do this in IOS and android but i don't want to make it in client i want to do this in server end,

FInd me full query below,

$movies = MovieApp::where('status',1)->has('screens')->with(['screens' => function($query) use($today_date) {

    $query->where('status',1)->where('from_date','=',$today_date)
    ->selectRaw(DB::raw('start_time, movie_id,screen_id, endtime, id'));

}])->with('language_details')->get();

now how can i get multiplication of start_time with 1000?

Please help me out