BossPogs

BossPogs

Member Since 8 Months Ago

Experience Points
2,070
Total
Experience

2,930 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 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,070 XP
Mar
15
2 months ago
Activity icon

Replied to HTML U.I For Smart TV

Unfortunately the TV that there bought is not latest one. Its browser is not the latest. It doesn't have the app store on it.

Mar
13
2 months ago
Activity icon

Replied to HTML U.I For Smart TV

Yeah there is a browser especially in smart tv. So if you did a dedicated app for that, how it would install on tv? I also agree on you that it would be a waste of time making it work on opera for tv.

Activity icon

Replied to HTML U.I For Smart TV

It would be tricky sir and still I need to learn that and long long way to go until it would be responsive. The problem also on my TV is the browser which is Opera and it is already outdated so I think some of the codes would not be working. I cannot update that browser also to the latest one and the latest for the Opera is Vewd. Anyway, it is a challenge to design a responsive U.I.

Mar
11
2 months ago
Activity icon

Replied to HTML U.I For Smart TV

Will you recommend what best for the responsive design for all devices including tv?

Mar
10
2 months ago
Activity icon

Replied to HTML U.I For Smart TV

Will html5 code would also work on tv?

Activity icon

Started a new Conversation HTML U.I For Smart TV

Hello newbie here. I just want to ask about the HTML u.i for Smart TV. I just wonder if your design would be different from computer in smart t.v. Because when I check in my computer, my website's design is okay. When I access in smart tv browser, it something different. Just like my html5 videos looping, it display the videos in my computer browser, but in smart tv, no videos is playing. It is my first time to do this system. Sorry if I had a hard time explaining my question, but I just want to ask because I had no idea about this.

Feb
27
3 months ago
Activity icon

Started a new Conversation Javascript On-Screen Keyboard Pops Out On A Specific Input Only

Hello. I had a touch screen monitor used for the kiosk in queuing system. Currently, I had install virtual keyboard extension in Firefox. It works. But in my system, I just want a specific input only to where an on-screen keyboard should only pops. For example I had two inputs.

<input type="number" id="amount" class="form-control" name="amount" step=".01" required> <-- this one should pop up the on-screen keyboard because it would type the amount-->

<input type="password" id="rfid" class="form-control" name="rfid" required> <--this one should not pop up the keyboard because it should tap the id-->

That's my concern for now. I've been also searching a plugin if that is possible.

Feb
24
3 months ago
Activity icon

Replied to Missing Required Parameters For [Route: Student.destroy] [URI: Student/{student}]

| DELETE | student/{student} | student.destroy | App\Http\Controllers\[email protected]

Activity icon

Replied to Missing Required Parameters For [Route: Student.destroy] [URI: Student/{student}]

Just this one sir Route::resource('student', 'StudentController');

Activity icon

Replied to Missing Required Parameters For [Route: Student.destroy] [URI: Student/{student}]

The error is now solved. However, there is another error, The DELETE method is not supported for this route. Supported methods: GET, HEAD, POST.

Activity icon

Started a new Conversation Missing Required Parameters For [Route: Student.destroy] [URI: Student/{student}]

Hello. I had confused with that error above and I double check that code I include the parameter. Check my code below

<form action="{{ route('student.destroy', $student->id) }}" method="POST" onsubmit="return confirm('Are you sure you want to unenroll?');" style="display: inline-block;">
                     <input type="hidden" name="_token" value="{{ csrf_token() }}">
                     <input type="hidden" name="_method" value="DELETE">
                     <input type="submit" class="btn btn-danger" value="Unenroll">
</form>

My code in controller

public function destroy($id)
    {
        $student = Student::where('student_id', $id)->first();

        //reset to active
        if ($student->enrolled == 0){
            $student->enrolled = 1;
            $student->save();

            return redirect()->back()->with('success','Student was successfully enrolled');
        }
        else{
            $student->enrolled = 0;
            $student->save();

            return redirect()->back()->with('error','Student is now unenrolled');
        }
    }

I'm still wondering why I get the error missing required parameters even I had already that one.

Feb
20
3 months ago
Activity icon

Replied to How To Print A Specific Div Only?

okay sir. will try that one

Activity icon

Replied to How To Print A Specific Div Only?

So my CSS code in my blade should transfer in print.css based on what I understand?

In print.css

@media print
        {
            .button
            {
                display: none;
            }
        }

        @media print
        {
            @page {
                margin-top: 0;
                margin-bottom: 0;
            }
            body {
                padding-top: 72px;
                padding-bottom: 72px;
            }
        }
Activity icon

Replied to How To Print A Specific Div Only?

I just load in my blade file in my style section

Activity icon

Replied to How To Print A Specific Div Only?

Okay sir I may struggle adjusting on its css sir.

Activity icon

Replied to How To Print A Specific Div Only?

screenshot

From the print preview. If you notice, the default printer is my POS printer that's why the paper in the preview is vertical. I just want the square one will only be print.

Activity icon

Started a new Conversation How To Print A Specific Div Only?

Hello. I've been trying to print a receipt. I want to print only the specific div and the size would be the same as the specific div as I print it in thermal printer.

<!DOCTYPE html>
<html>
<head>
    <style type="text/css">
        @media print
        {
            .button
            {
                display: none;
            }
        }

        @media print
        {
            @page {
                margin-top: 0;
                margin-bottom: 0;
            }
            body {
                padding-top: 72px;
                padding-bottom: 72px;
            }
        }
    </style>
</head>

<body style="background: #f9f9f9">

    <div class="container">
        <div class="row">
            <div class="col-xs-12">
        
        <-- THIS DIV ONLY -->
                <div id="print" class="print" style="border: 1px solid #a1a1a1; width: 88mm; background: white; padding: 10px; margin: 0 auto; text-align: center;">

                    <div class="invoice-title" align="center">
                        <span id="num2" style="font-size:85px; font-weight:bold;line-height:1.45">
                            {{ $call->letter }}-{{ $call->number }}
                        </span>
                    </div>

                    <div class="invoice-title" align="center">
                        <b>{{ $call->trans_name ?? 'no transaction' }}</b>
                    </div>
                    

                    <div class="invoice-title" align="center">
                        <b>Php {{ $call->amount }}</b>
                    </div>

                    <div class="invoice-title" align="center">
                        <b>Issued on {{$call->created_at}}</b>
                    </div>

                    <br>
                    
                </div>
            </div>
        </div>
    </div>

    


    <script type="text/javascript">
        myFunction();

        function myFunction(){
            window.print();
        }

        window.onafterprint = function(e){
            closePrintView();
        }

        function closePrintView(){
            window.location.href = '{{ route('office.show', ['name' => $call->office_name]) }}'     
        }
    </script>
</body>
</html>

In my specific div, it specifies it size and only that div will be printed only. I've been struggling on that for a long time and trying everything I search.

Feb
17
3 months ago
Activity icon

Replied to Laravel ESCPOS

Thank you for sharing it. I will study that one. If I deploy my website on the server it would print it to any thermal printer?

Jan
28
4 months ago
Activity icon

Replied to How To Add Multiple Child Row Data Together With Parent Row In Laravel Blade

My problem in my store query was it will insert only 1 data although I input multiple data.

public function store(Request $request)
    {
       
            $requisition = Requisition::create([
                'purpose' => $request->input('purpose'),
                'requisition_date' => $request->input('requisition_date'),
                'requested_by' => $request->input('requested_by')
            ]);  
            
            $rows = $request->input('rows');

            foreach ($rows as $row)
            {
                $items[] = [
                    'requisition_id' => $requisition->id,
                    'qty' => $row['qty'],
                    'unit' => $row['unit'],
                    'description' => $row['description']
                ];
            }
            
            RequisitionItem::insert($items);
    }
Activity icon

Started a new Conversation How To Add Multiple Child Row Data Together With Parent Row In Laravel Blade

Hello guys. I've been trying to work the adding of multiple data through blade. In my blade form, I'm using the clone, adding rows. For example, one requisition has many items.

My blade view

Blade view code

<form autocomplete="off" method="POST" action="{{ route("requisition.store") }}" enctype="multipart/form-data">
            @csrf
            <div class="form-group">
                <label class="required" for="purpose">Purpose</label>
                <input class="form-control" type="text" name="purpose" id="purpose" required>
                <span class="help-block"></span>
            </div>

            <div class="form-group">
                <label class="required" for="requisition_date">Date</label>
                <input class="form-control" type="date" name="requisition_date" id="requisition_date" required>
                <span class="help-block"></span>
            </div>

            <div class="form-group">
                <label class="required" for="requested_by">Released By</label>
                <input class="form-control" type="text" name="requested_by" id="requested_by" required>
                <span class="help-block"></span>
            </div>

            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>Qty</th>    
                        <th>Unit</th>    
                        <th>Description</th>   
                        <th>
                            <a href="#" class="addRow"><i class="fas fa-plus"></i></a>    
                        </th> 
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                            <input type="number" name="qty[]" class="form-control quantity" required>  
                        </td>    
                        <td>
                            <input type="text" name="unit[]" class="form-control" required>  
                        </td>    
                        <td>
                            <input type="text" name="description[]" class="form-control" required>  
                        </td> 
                        <td>
                            <a href="#" class="btn btn-danger remove">
                                <i class="fas fa-times"></i>
                            </a>    
                        </td>   
                    </tr>    
                </tbody>    
            </table>

            <div class="form-group">
                <label for="filename">Upload Image File</label>
                <div class="input-group control-group increment" >
                    <input type="file" name="filename[]" class="form-control">
                    <div class="input-group-btn"> 
                    <button class="btn btn-success" type="button"><i class="glyphicon glyphicon-plus"></i>Add</button>
                    </div>
                </div>
                
                <div class="clone hide">
                    <div class="control-group input-group" style="margin-top:10px">
                    <input type="file" name="filename[]" class="form-control">
                    <div class="input-group-btn"> 
                        <button class="btn btn-danger" type="button"><i class="glyphicon glyphicon-remove"></i> Remove</button>
                    </div>
                    </div>
                </div>
            </div>
           
            <div class="form-group">
                <button class="btn btn-danger" type="submit">
                    Save
                </button>
            </div>
        </form>

And the Store Controller

public function store(Request $request)
{
        $requisition = Requisition::create([
                'purpose' => $request->input('purpose'),
                'requisition_date' => $request->input('requisition_date'),
                'requested_by' => $request->input('requested_by')
            ]);  
            
            
            foreach($requisition as $item)
            {
                $requisition_item = RequisitionItem::create([
                    //still figuring what would be the code
                ]);
            }
}

requistion table = id, purpose, requisition_date, requested_by requisition_item table = id, requisition_id, qty, unit, description

Jan
10
4 months ago
Activity icon

Replied to How To Solve 500 Internal Error In Laravel?

in what log? sorry i'm still a newbie

Activity icon

Replied to How To Solve 500 Internal Error In Laravel?

Even when I reload sometimes a webpage. I just caught up again and I debug in a console bar Failed to load resource: the server responded with a status of 500 (Internal Server Error). I just reload that page and its okay.

Jan
09
4 months ago
Activity icon

Started a new Conversation How To Solve 500 Internal Error In Laravel?

Hello. I often get 500 internal error especially when I adding a data. I check also the htaccess file in my project and I don't know what I gonna do with that. The server that I used is XAMPP

Jan
08
4 months ago
Activity icon

Replied to Connecting A Laravel Project In An Existing PHP Project

The existing PHP project is already built by my other members and I'm still new member in their team. I used to build projects with Laravel that's why I'm thinking if I gonna use Laravel.

Activity icon

Started a new Conversation Connecting A Laravel Project In An Existing PHP Project

Hello. I'm gonna make a new Laravel project and I will connect it in an existing PHP project because the Laravel project I gonna make is part of the existing PHP project system. Is it that possible that it can merge my Laravel project to PHP project? And my concern is, the session of the logged in user if the user is login in a PHP app, he is also logged in a Laravel app?

Dec
11
5 months ago
Activity icon

Started a new Conversation Laravel Pusher Not Working Again

Hello. My pusher is not working again but when I check in the Pusher dashboard it is working. I try the php artisan config:clear but it is not working again.

call.blade.php

<div class="col-md-12">
                <form id="form-data" class="form-horizontal" method="POST" action="updatecall">
                    {{ csrf_field() }}
                    <div class="table-responsive">
                        <table class="table table-bordered" id="example" width="100%" cellspacing="0">
                            <tr>
                                @if($callid === null)
                                
                                @else
                                <input type="hidden" class="form-control" id="google/cloud-text-to-speech" name="call_id" value="{{ $callid->id }}" readonly>
                                <td><label>Probably Next Call</td>
                                <td><span id="letter">{{ $callid->letter }}</span>-<span id="number">{{ $callid->number }}</span></td>
                                <td>
                                    <button type="submit" class="btn btn-success btn-fill pull-right" id="update" float:right>
                                        CALL NEXT
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
            @endif
        </div>  

<script>
$(document).ready(function() {
    // Enable pusher logging - don't include this in production
    Pusher.logToConsole = true;

    var pusher = new Pusher('586c6fb979ff3d2ad3b1', {
      cluster: 'ap1',
      forceTLS: true
    });

    var channel = pusher.subscribe('my-channel');
    channel.bind('my-event', function(data) {
        //alert(JSON.stringify(data));

        $("#call_id").val(data.id);
        $("#letter").html(data.letter);
        $("#number").html(data.number);
        
    }); //code that's not working


});
</script>

Controller

public function store(Request $request)
    {
        //query sa pag get counter gamita ang assignments
        $counter_id = Assignment::where('user_id', Auth::user()->id)
                    ->first();

        $called = Call::find($request->input('call_id'));
        $called->user_id = Auth::user()->id;
        $called->counter_id = $counter_id->counter_id; 
        $called->called = 'YES';
        $called->save();

        /*$office_id = Office::join('users', 'offices.id', '=', 'users.office_id')
                    ->select('offices.id')
                    ->where('users.id', Auth::user()->id)
                    ->first();*/
        $office_id = User::where('id', Auth::user()->id)->first();
        
        $callid = Call::join('transactions', 'calls.trans_id', '=', 'transactions.id')
                ->join('offices', 'transactions.office_id', '=', 'offices.id')
                ->select('calls.*')
                ->where('calls.called', 'NO')
                ->where('offices.id', $office_id->office_id)
                ->oldest('calls.created_at')
                ->first();

        if($callid != null)
        {
            // pusher
            $options = array(
                'cluster' => 'ap1',
                'useTLS' => true
            );

            $pusher = new Pusher(
                env('PUSHER_APP_KEY'),
                env('PUSHER_APP_SECRET'),
                env('PUSHER_APP_ID'),
                $options
            );

            $data = ['letter' => $callid->letter, 'number' => $callid->number, 'id' => $callid->id]; // sending calls: letter, number, id aron magupdate siya
            $pusher->trigger('my-channel', 'my-event', $data);
        }
        
        return redirect()->route('call.index')->with('success' , 'CALLED');
    }

On the other the pusher is working but today I was shocked it was not working in my laravel project but when I check in the pusher dashboard, the pusher is working

Dec
10
5 months ago
Activity icon

Started a new Conversation Silent Printing Without Print Preview And Dialog

Anyone who have an idea of silent printing in any printer either thermal, inkjet, etc.? I've been searching it and I had a hard time. Some are deprecated already. I've been searching in the 2019 version. In my project, after clicking create, I redirect it on the show where the print layout and is shown. I want that it would print directly without showing the layout and refresh the page.

Dec
09
5 months ago
Activity icon

Replied to Slow Response After Clicking Add Button In Laravel

What do you mean sir in the query itself in store method?

Dec
05
5 months ago
Activity icon

Replied to Slow Response After Clicking Add Button In Laravel

I think I would need to revise my query or I don't know.

Activity icon

Replied to Slow Response After Clicking Add Button In Laravel

One of those store query

public function store(Request $request)
    {
        $letter = Office::join('transactions', 'offices.id', '=', 'transactions.office_id')
            ->select('offices.letter')
            ->where('transactions.id', $request->input('trans_id'))
            ->first();

        $number = Office::join('transactions', 'offices.id', '=', 'transactions.office_id')
            ->select('offices.start')
            ->where('transactions.id', $request->input('trans_id'))
            ->first();

        if($request->input('rfid') == '')
        {
            $call = Call::create([
                'letter' => $letter->letter,
                'number' => $number->start,
                'called' => 'NO',
                'trans_id' => $request->input('trans_id'),
                'guest_name' => $request->input('name'),
                'amount' => $request->input('amount'),
                'num_calls' => 0
            ]);
        }
        else
        {
            //validation
            $no_rfid = Student::where('rfid', $request->input('rfid'))
                    ->exists();
        
            //if validation fails
            if($no_rfid == false)
            {
                return redirect()->back()->with('error', 'Your RFID does not exist in this system. Please type your name.');
            }

            $call = Call::create([
                'letter' => $letter->letter,
                'number' => $number->start,
                'called' => 'NO',
                'trans_id' => $request->input('trans_id'),
                'student_id' => $student_id->student_id,
                'amount' => $request->input('amount'),
                'num_calls' => 0
            ]);
        }
        
        Office::where('letter', $letter->letter)
        ->increment('start');

        return redirect()->route('call.show', ['call'=> $call->id]);
    }
Activity icon

Replied to Slow Response After Clicking Add Button In Laravel

Actually it is still in development because of some errors including that slow response but it is now put in the production server. In the production, it is a slow response time. That's why I'm fixing it those in my localhost computer. Additionally in the production server (windows server), we use xampp there.

Activity icon

Started a new Conversation Slow Response After Clicking Add Button In Laravel

Hello. I have a concern on my project which is slow response. After clicking add button, it takes a seconds like 5 or more before the actual inserting data takes place. I wonder if it will be on my query or its project itself. But my question, is there a ways that to make my laravel project response time faster?

Activity icon

Replied to Laravel Pusher

Thank you Sir @vishy . I will spend some time on Javascript DOM management and JQuery. Thanks a lot.

Dec
04
5 months ago
Activity icon

Replied to Laravel Pusher

UPDATE: I got it now. My problem is I cannot click the call next button after a pusher update.

Activity icon

Replied to Laravel Pusher

The specific div reload did not work for me. I think I have an error in my code here

call.blade.php

<div class="col-md-12" id="new_call">
            @if($callid === null)
        
            @else
                <form id="form-data" class="form-horizontal" method="POST" action="updatecall">
                    {{ csrf_field() }}
                    <div class="table-responsive">
                        <table class="table table-bordered" id="example" width="100%" cellspacing="0">
                            <tr>
                                <input type="hidden" class="form-control" id="call_id" name="call_id" value="{{ $callid->id }}" readonly>
                                <td><label>Probably Next Call</td>
                                <td><span id="letter">{{ $callid->letter }}</span>-<span id="number">{{ $callid->number }}</span></td>
                                <td>
                                    <button type="submit" class="btn btn-success btn-fill pull-right" id="update" float:right>
                                        CALL NEXT
                                    </button>
                                </td>
                            </tr>
                        </table>
                    </div>
                </form>
            @endif
</div> 

I just paste my specific div which is set to refresh

Pusher Javascript code also in call.blade.php

var channel = pusher.subscribe('my-channel');
    channel.bind('my-event', function(data) {
        const html = `<input type="hidden" class="form-control" id="call_id" name="call_id" value="${data.id}" readonly><span class="letter"> ${data.letter}</span>-<span class="number">Number: ${data.Number}</span>`;
        const specific_div = $('#new_call');
        // Empty the div
        specific_div.empty();
        // Populate new html
        specific_div.append(html);
});
Dec
03
5 months ago
Activity icon

Replied to Laravel Pusher

Okay sir. But my div id is not with the data something like this <div id="new_call>. Is it okay or is it really need to have an id num on it? and also can I do this also

const html = `<input type="hidden" class="form-control" id="call_id" name="call_id" value="${data.id}" readonly><span class="letter"> ${data.letter}</span>-<p>Number: ${data.Number}</p>`;

so that I can change also the value in the input?

Activity icon

Started a new Conversation Laravel Pusher

I'm currently learning pusher and applying it in my queuing management project. I almost done applying it in my project as I do this:

In my blade view file in section

var channel = pusher.subscribe('my-channel');
    channel.bind('my-event', function(data) {
        alert(JSON.stringify(data));
      
 });

which I test that my pusher is working. Now my question is how do I refresh a specific div after the data was sent. Like this

var channel = pusher.subscribe('my-channel');
    channel.bind('my-event', function(data) {
        //refresh specific div here after the data was sent     
 });

I will show also the controller

public function store(Request $request)
{
      $call = Call::create([
                'letter' => $letter->letter,
                'number' => $number->start,
                'called' => 'NO',
                'trans_id' => $request->input('trans_id'),
                'guest_name' => $request->input('name'),
                'amount' => $request->input('amount'),
                'num_calls' => 0
           ]);

            // pusher
            $options = array(
                'cluster' => 'ap1',
                'useTLS' => true
            );

            $pusher = new Pusher(
                env('PUSHER_APP_KEY'),
                env('PUSHER_APP_SECRET'),
                env('PUSHER_APP_ID'),
                $options
            );

            $data = ['letter' => $call->letter, 'number' => $call->number, 'id' => $call->id]; 
            $pusher->trigger('my-channel', 'my-event', $data);
Dec
01
6 months ago
Activity icon

Replied to Laravel ESCPOS

Okay sir thanks for helping sir. I'll write the codes there and see if will work.

Activity icon

Replied to Laravel ESCPOS

Okay sir. I'll reading its docs, forums, etc and figuring out on how to use it in laravel. I'm working its code in my controller. Now, I'm also figuring out if I can use my html layout for printing its receipt in escpos and it seems difficult for me.

Activity icon

Started a new Conversation Laravel ESCPOS

Hello. Is there is any tutorial on using ESCPOS in Laravel? All I see are php escpos. I decided to use it so that the silent printing will be effective. Also, I'm also searching on how to design a layout in escpos.