BossPogs

BossPogs

Member Since 1 Month Ago

Experience Points
910
Total
Experience

4,090 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
910 XP
Oct
20
21 hours ago
Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Like this one sir?

var vidSources = [
  @foreach($videos as $video)
  "{{ url('storage/'. $video->video_file) }}",
  @endforeach
];
Oct
19
1 day ago
Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

It doesn't work sir. In the network tab, this is the url http://127.0.0.1:8000/queue/queue/videos/YKL1YnxzyLPaFG6SgTRy1qh2A1l65Gio5orMUcFy.mp4. The queue was doubled. To avoid confusion, this is how I declared the route for that window page Route::get('/queue/{name}', '[email protected]')->name('display.show');.

Oct
18
2 days ago
Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

oh so sadly I cannot autoplay loop my videos from my database. So sir is it not possible to autoplay loop videos from db?

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Here sir @sinnbeck

[email protected]

public function store(Request $request)
    {
        if (request()->has('video_file'))
        {
            Video::create([
                'video_file' => $request->file('video_file')->store('videos', 'public')
            ]);
        }
      
        return redirect()->route('video.index')->with('success' , 'Video uploaded successfully');
    }
Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Okay sir I will try to figure out that one sir

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

It works now sir @cyberkingyash. How about if you want to play the videos from the database, it would still work?

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Okay sir. So I revert back to my http://127.0.0.1:8000/queue/videos/laughsome.mp4 where it is save in my hard drive at the same time it is under public/videos and it is the same sir.

var vidSources = [
  "videos/laughsone.mp4",
  "videos/vidone.mp4",
 ];

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

For now is this one sir http://127.0.0.1:8000/queue/videos/GJpq2NfwNONwl0SeYhQ1uSXKu6vhcmW6CVT9sPSS.mp4 because I based my video on my database. This one http://127.0.0.1:8000/queue/videos/laughsome.mp4 that was before when I am not still using from my database. The http://127.0.0.1:8000/queue/videos/GJpq2NfwNONwl0SeYhQ1uSXKu6vhcmW6CVT9sPSS.mp4 is coming from the @foreach($videos as $video) "{{ $video->video_file }}", @endforeach

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Yes I see it sir on the network tab. It said Failed to response data. And by the way, I see in the console tab that I use the blade syntax, in the console it provides the video files so I think it is not a problem if you use a blade syntax file on the script code

Activity icon

Replied to Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

okay sir. But even before I change into blade syntax when I put the files like this

var vidSources = [
    "videos/laughsone.mp4",
    "videos/fly.mp4"
];
Activity icon

Started a new Conversation Failed To Load Resource: The Server Responded With A Status Of 404 (Not Found)

Hello, I'm doing a video looping with auto-play. My video looping was working before and the videos were play. But after I put some adjustments on my page and my logic, it was broken and the videos were not play. I got the error Failed to load resource: the server responded with a status of 404 (Not Found)

js code

<script type="text/javascript">

var vidElement = document.getElementById('video');
var vidSources = [
    @foreach($videos as $video)
    "{{ $video->video_file }}",
    @endforeach
  ];
var activeVideo = Math.floor((Math.random() * vidSources.length));
vidElement.src = vidSources[activeVideo];
vidElement.addEventListener('ended', function(e) {
  // update the active video index
  activeVideo = (++activeVideo) % vidSources.length;
  if(activeVideo === vidSources.length){
    activeVideo = 0;
  }

  // update the video source and play
  vidElement.src = vidSources[activeVideo];
  vidElement.play();
});

</script>

I'm finding away to solve that problem

Activity icon

Replied to Uploading Video In DB In Laravel: Call To A Member Function Store() On Null

It's now okay sir after I add enctype=multipart/form-data. Is it just okay that after I uploaded the video in the db the file name change?

Oct
17
3 days ago
Activity icon

Started a new Conversation Uploading Video In DB In Laravel: Call To A Member Function Store() On Null

Hello. I'd be trying to upload a video in a database but I got an error Call to a member function store() on null.

[email protected]

public function store(Request $request)
    {
        if (request()->has('video_file'))
        {
            Video::create([
                'video_file' => $request->file('video_file')->store('videos', 'public')
            ]);
        }
      
        return redirect()->route('video.index')->with('success' , 'Video uploaded successfully');
    }

I'd just base the code in tutorials and in the forum.

Oct
15
5 days ago
Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

Yes I'll try that one in the future. I am having a difficulty on the pusher/web sockets for now that's why I used AJAX for now.

Oct
11
1 week ago
Activity icon

Replied to ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

Or maybe sir is it possible that you can stop the setInterval and when you add another data the setInterval would run again?

Activity icon

Replied to ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

Sir @sinnbeck . The error in the console I found might be here responsiveVoice.speak(data.letter + '-' data.letter + ' please proceed to Counter ' . data.counter_id, parameters) which says Uncaught SyntaxError: missing ) after argument list. In the network tab I cannot find the /getnewdata request

Activity icon

Replied to ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

It doesn't refresh sir. It doesn't work.

Activity icon

Replied to ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

Yes sir. Every time it should change for each call and it will only speak once.

Activity icon

Replied to ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

I try this one

$( document ).ready(function() {
    setInterval(function() {
      $.ajax({
        url: "/getnewdata",
        cache: false,
      }).done(function(html) {
          $( '#data-container' ).html(html);
          setTimeout(function() {
            function voiceStartCallback() {
                console.log("Voice started");
            }
            
            function voiceEndCallback() {
                console.log("Voice ended");
            }
            
            var parameters = {
                onstart: voiceStartCallback,
                onend: voiceEndCallback
            }
            responsiveVoice.speak("{{ $new_call->letter }}-{{ $new_call->number }} please proceed to Counter {{ $new_call->counter_id }}", parameters)
          }, 800);
      });
    }, 3000);    
  });

When I look at the console it has an error: Uncaught TypeError: Cannot read property 'deprecated' of null at ResponsiveVoice.a.speak (responsivevoice.js?key=8PNDpxy8:117) at queue:178

Oct
10
1 week ago
Activity icon

Started a new Conversation ResponsiveVoice Code Within SetInterval In Javascript: How To Stop The Loop?

Hello. Currently I'm doing queuing system and I'm working on voice announcing using responsive voice. I put it on the setInterval but the problem is it is looping and the voice would never stop.

$( document ).ready(function() {
    setInterval(function() {
      $.ajax({
        url: "/getnewdata",
        cache: false,
      }).done(function(html) {
          $( '#data-container' ).html(html);
      });
      responsiveVoice.speak("{{ $new_call->letter }}-{{ $new_call->number }} please proceed to Counter {{ $new_call->counter_id }}")
    }, 3000);
});

I just want that voice announcer would only loop once. Another problem, when the data is newly added, it should announce a data. And another problem is instead of for example "no. 30", it speaks "no. 29".

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

Okay sir I'l make another thread for that. Thanks for your help I gonna mark your answer as the best one

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

This is what I just did sir

$( document ).ready(function() {
    setInterval(function() {
      $.ajax({
        url: "/getnewdata",
        cache: false,
      }).done(function(html) {
          $( '#data-container' ).html(html);
      });
      responsiveVoice.speak("{{ $new_call->letter }}-{{ $new_call->number }} please proceed to Counter {{ $new_call->counter_id }}")
    }, 3000);
});

I put it on the setInterval but the problem is it is looping and the voice would never stop. What I mean is when the data is newly added, it should announce a data. And another problem is instead of for example "no. 30", it speaks "no. 29".

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

I found out the solution which is I set it in setInterval. One last question: where should I put this one setTimeout(responsiveVoice.speak("{{ $call->letter }}-{{ $call->number }} please proceed to Counter {{ $call->counter_id }}"),3000);?

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

It's alright sir. Now it is work. The problem is now for example, I just open the page b. After I add an item in page a it refresh but when I add another one it would not refresh again. For short, it only refresh once.

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

Uncaught SyntaxError: Unexpected token ')' at this part )}, 5000);

I'll try that one sir

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

it doesn't get an error but it would not just refresh. i'll open the console to figure it out

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

it doesn't work for me sir. this is how did I did

queue.blade.php

@extends('layouts.master')

@section('content')
<div class="container-fluid">
  <div class="card-group">
    <!-- Part to be refresh -->
      <div id="data-container" class="card"  style="background-color: gold;"> 
          <br>
          <div class="row text-center">
              <div class="col-sm-5">
                <div class="number">
                  <h2 data-to="1700" data-speed="1500" style="color:white; font-size: 90px">{{ $new_call->letter }}-{{ $new_call->number }}</h2>
                  <p class="count-text" style="color:white;font-size: 20px">Counter {{ $new_call->counter_id }}</p>
                </div>
              </div>
          </div>
          <br>
          @foreach($calls as $call)  
          <div class="row text-center">
              @if ($call === null)

              @else
              <div class="col-sm-5">
                <div class="counter">
                  <h2 data-to="1700" data-speed="1500" style="color:white; font-size: 90px">{{ $call->letter }}-{{ $call->number }}</h2>
                  <p class="count-text" style="color:white;font-size: 20px">Counter {{ $call->counter_id }}</p>
                </div>
              </div>

              @endif
          </div>
          <br>
          @endforeach

      </div>

      <div class="card-video">
          <video id="video" autoplay muted playsinline  width="910" height="600" controls></video>
      </div>
  </div>
</div>
@endsection

@section('scripts')
<script>
  setTimeout(function() {
    $.ajax({
      url: "/getnewdata",
      cache: false,
    }).done(function(html) {
        $( '#data-container' ).html(html);
    });
  )}, 5000);
</script>
@endsection

partial.blade.php

<div id="data-container" class="card"  style="background-color: gold;"> 
          <br>
          <div class="row text-center">
              <div class="col-sm-5">
                <div class="number">
                  <h2 data-to="1700" data-speed="1500" style="color:white; font-size: 90px">{{ $new_call->letter }}-{{ $new_call->number }}</h2>
                  <p class="count-text" style="color:white;font-size: 20px">Counter {{ $new_call->counter_id }}</p>
                </div>
              </div>
          </div>
          <br>
          @foreach($calls as $call)  
          <div class="row text-center">
              @if ($call === null)

              @else
              <div class="col-sm-5">
                <div class="counter">
                  <h2 data-to="1700" data-speed="1500" style="color:white; font-size: 90px">{{ $call->letter }}-{{ $call->number }}</h2>
                  <p class="count-text" style="color:white;font-size: 20px">Counter {{ $call->counter_id }}</p>
                </div>
              </div>

              @endif
          </div>
          <br>
          @endforeach
</div>

Display Controller

public function index()
    {      
        $calls = Call::where('called', 'YES')
                ->latest('updated_at')
                ->skip(1)->take(2)
                ->get();  

        $new_call = Call::where('called', 'YES')
                ->latest('updated_at')
                ->first();
       
        return view('queue', ['calls'=>$calls, 'new_call'=>$new_call]);
    }

    public function getNewData()
    {
        $calls = Call::where('called', 'YES')
                ->latest('updated_at')
                ->skip(1)->take(2)
                ->get();  

        $new_call = Call::where('called', 'YES')
                ->latest('updated_at')
                ->first();
       
        return view('partial', ['calls'=>$calls, 'new_call'=>$new_call]);
    }

Route\web.php

Route::get('/queue', '[email protected]')->name('display.index');
Route::get('/getnewdata', '[email protected]');
Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

so its like that an another {{ route( ) }} that contains like a div that you want to partially refresh?

Activity icon

Replied to Adding A Data From Page A And Auto-reload The Page B After Adding A Data

sir @sinnbeck have a little bit confusion.

jquery code in pageb.blade.php for example

setTimeout(function() {
        $.ajax({
          url: "{{ route('pageb.index') }}", //for example in a pageb controller index which returns pageb.blade.php
          cache: false,
        }).done(function(html) {
            $( '#data-container' ).html(html);
        });
    )}, 5000);

Is that right sir?

Oct
09
1 week ago
Activity icon

Started a new Conversation Adding A Data From Page A And Auto-reload The Page B After Adding A Data

Hello I was working a project in Laravel. I've been searching a Javascript logic on adding the data from Page A and auto-reload it on Page B. Here's my example, pageA.blade.php is only add/insert form, just only add data. On pageB.blade.php, it only displays the data. So when I add a data in Page A, after that it would auto-reload the Page B to show the new data only once. Right now, I just use my laravel widgets to do that but the problem is it reloads every n seconds. I just want to reload it once because I have a responsive voice feature on that and it doesn't stop the looping. So, right now I've been searching for the javascript logic for that. Another option that I look for is through websockets but I have a hard time.

Oct
01
2 weeks ago
Activity icon

Replied to Laravel Widgets $reloadTimeout Once Only

yes it will not reload at all if it set in false. but I want to set the reload at least once, twice, or thrice and it will reload it again when the data is update. so far in their docs reloadTimeout = n means reloading every n seconds

Activity icon

Started a new Conversation Laravel Widgets $reloadTimeout Once Only

Hello first of all does anyone uses Laravel Widgets? And 2nd if you know about it, is it possible that the $reloadTimeout will only reload once? Because in its documentation $reloadTimeout reload every N seconds

Sep
24
3 weeks ago
Activity icon

Replied to Print Ticket After Adding A Data

Okay so when it will print in a thermal printer that will automatically print in a thermal print format?

Sep
23
3 weeks ago
Activity icon

Replied to Print Ticket After Adding A Data

Finally I got it now. Thanks @cronix @jlrdw @willvincent . Now my last step is disabling the print preview and directly print it in a thermal printer

Activity icon

Replied to Print Ticket After Adding A Data

okay I'll try that suggestion and also I understand @cronix explained. if I resolved that one I need to figure out printing without a print preview and directly print in a thermal printer

Sep
22
4 weeks ago
Activity icon

Replied to Print Ticket After Adding A Data

Because I gonna print it in a thermal printer

Activity icon

Started a new Conversation Print Invoice Plugin In Laravel

Hello do you have any suggestions of any print invoice/receipt plugin in Laravel? Not thru PDF but print to printer. Like in the grocery after it pay it print the receipt.

Sep
20
1 month ago
Activity icon

Replied to Print Ticket After Adding A Data

no what I want

modal-ui

As you can see in the image above after the user will click create then it will add in the db and after reload there is like a ticket receipt showing the token like "C-1" like in the queuing system

Sep
19
1 month ago
Activity icon

Replied to Print Ticket After Adding A Data

If you see my code <button type="submit" class="btn btn-success btn-fill pull-right" id="form-button-add" name="form-button-add" onclick="window.print()"> CREATE <!--CREATE, SAVE AND PRINT THE TICKET--> </button> the onclick window.print would work but the prn preview shows the modal form. Sadly I can't show pic here

Activity icon

Replied to AJAX Code In Laravel Controller

Thanks. Its great that we're learning altogether. Well I gonna study it

Activity icon

Replied to AJAX Code In Laravel Controller

The AJAX one. The sample code gave by jlrdw.