ThePoet444

ThePoet444

Member Since 5 Years Ago

Experience Points
77,280
Total
Experience

2,720 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
914
Lessons
Completed
Best Reply Awards
1
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 16
77,280 XP
Jan
16
1 month ago
Activity icon

Started a new Conversation Websockets Only Work Once Browser Hits Wss Endpoint

I'm currently using beyondcode/laravel-websockets. I have everything setup according to the instructions. The only way to get it to work however, is if I point my browser to the same link the websocket is trying to reach. Once I do that, everything is golden. I can't expect the users to hit that endpoint first, especially since the socket is only on the main page. What do I need to change to just have everything work?

Not sure what code you need to look at, but I'm happy to post updates to anything.

Thanks in advance for any assistance.

Bootstrap.js

/**
 * Echo exposes an expressive API for subscribing to channels and listening
 * for events that are broadcast by Laravel. Echo and event broadcasting
 * allows your team to easily build robust real-time web applications.
 */

import Echo from 'laravel-echo';
window.Pusher = require('pusher-js');

window.Echo = new Echo({
    broadcaster: 'pusher',
    authEndpoint: 'broadcasting/auth',
    key: 'rsmain1key',
    cluster: 'rsmain',
    encrypted: true,
    forceTLS: false,
    wsHost: window.location.hostname,
    wsPort: 6001,
    wssPort: 6001,
    disableStats: true,
    csrfToken: document.head.querySelector('meta[name="csrf-token"]').getAttribute('content'),
    enabledTransports: ['ws', 'wss']
});
config/websockets
Note: This location '/home/vagrant/code/ssl/' is a symbolic link to '/etc/nginx/ssl/'

 'ssl' => [

        'local_cert' => '/home/vagrant/code/ssl/rsmain.test.crt',

        'local_pk' => '/home/vagrant/code/ssl/rsmain.test.key',

        'passphrase' => env('LARAVEL_WEBSOCKETS_SSL_PASSPHRASE', null),

        'allow_self_signed' => true,
        'verify_peer' => false,
    ],
Oct
23
3 months ago
Activity icon

Replied to Multi Model, Abstract Model, Or Something Else?

I knew I could do 3 separate models, I just wasn't sure where all 3 shared a similar data structure if there was another way of doing it. The scopes to get the commanding officers is nice though. I'll have to use those.

Oct
22
3 months ago
Activity icon

Replied to Multi Model, Abstract Model, Or Something Else?

I was looking at a polymorphic setup, and while I understand it, I was having a hard time wrapping my brain around it for this setup. However, now that I walked away for a bit, I can see it now. I wasn't sure if there was another "trick" I didn't know about to accomplish this.

Oct
20
3 months ago
Activity icon

Started a new Conversation Multi Model, Abstract Model, Or Something Else?

I have a grandparent->parent->child setup going. Specifically Fleet->Wing(s)->Squad(s), or Fleet->Squad(s) as wings can be optional. Normally I would just use 3 separate models and be done with it. However, I got to thinking, all three will have the same DB setup. They will each have name, description, motto, co,xo,so wings will have parent id and squads will have parent id and one or two specific fields. While I would be interested in "best practice", I'm more curious how others would handle this setup.

Can I do a Unit class and then have three models extend that, but still use the unit_id as a foreign key reference? Should I just use three models? or is there another way I haven't thought of?

Thanks for any insights.

Oct
11
4 months ago
Activity icon

Replied to Invalid Request (unsupported Ssl Request)

I've used .test seems to be fine for self signed certs.

Sep
19
4 months ago
Activity icon

Replied to All Policies Returns True On One Page Only

Well since I don't know where the problem lies, I don't know what code to post. If anyone can give me some insight, I'll gladly post more relevant code.

Activity icon

Replied to All Policies Returns True On One Page Only

To make this even more interesting, I can add {{dd(Auth::user()->can('noPermissionsFound'))}} and it returns true. So something is making just the forum index page have all policies return true. I'm not sure where to begin, I'll post on Riari's github to see if it's something there, but this one has me really confused.

Activity icon

Replied to All Policies Returns True On One Page Only

partial.nav

...
    </div>

        <div class="nav nav-pills ml-auto">
            @can('admin')<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="/permissions">Permissions Admin</a>@endcan
            @can('admin')<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="/telescope">Errors Page</a>@endcan
            @auth<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="{{route('profile', Auth::user()->id)}}">Profile</a>@endauth
        </div>

        <div class="nav nav-pills ml-2">
            @auth<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="https://github.com/ThePoet444/RebelSquadronsSite">Report Bugs</a>@endauth
            @guest<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="{{route('login')}}">Login</a>@endguest
            @guest<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="{{route('register')}}">Register</a>@endguest
            @auth<a class="nav-link rsbtn rsbtn-main rsText-main-white mr-1" href="{{route('logout')}}">Logout</a>@endauth
        </div>
...

No matter where I am on my site, those checks work. Be they the can, guest, or auth. they all work. EXCEPT on one page. the url '/forum'

This page, I had to modify a bit to fit with my existing layout.

forum.master (modified from Riari/laravel-forum-frontend

@extends('layouts.app')

@section('title')
    @if (isset($thread))
        {{ $thread->title }} -
    @endif
    @if (isset($category))
        {{ $category->title }} -
    @endif
    {{ trans('forum::general.home_title') }}
@stop

@section('content')
    <div class="container">
        @include ('forum::partials.breadcrumbs')
        @include ('forum::partials.alerts')

        @yield('forum_content')
    </div>
@stop

@section('scripts')
    <script>
        var toggle = $('input[type=checkbox][data-toggle-all]');
        var checkboxes = $('table tbody input[type=checkbox]');
        var actions = $('[data-actions]');
        var forms = $('[data-actions-form]');
        var confirmString = "{{ trans('forum::general.generic_confirm') }}";

        function setToggleStates() {
            checkboxes.prop('checked', toggle.is(':checked')).change();
        }

        function setSelectionStates() {
            checkboxes.each(function() {
                var tr = $(this).parents('tr');

                $(this).is(':checked') ? tr.addClass('active') : tr.removeClass('active');

                checkboxes.filter(':checked').length ? $('[data-bulk-actions]').removeClass('hidden') : $('[data-bulk-actions]').addClass('hidden');
            });
        }

        function setActionStates() {
            forms.each(function() {
                var form = $(this);
                var method = form.find('input[name=_method]');
                var selected = form.find('select[name=action] option:selected');
                var depends = form.find('[data-depends]');

                selected.each(function() {
                    if ($(this).attr('data-method')) {
                        method.val($(this).data('method'));
                    } else {
                        method.val('patch');
                    }
                });

                depends.each(function() {
                    (selected.val() == $(this).data('depends')) ? $(this).removeClass('hidden') : $(this).addClass('hidden');
                });
            });
        }

        setToggleStates();
        setSelectionStates();
        setActionStates();

        toggle.click(setToggleStates);
        checkboxes.change(setSelectionStates);
        actions.change(setActionStates);

        forms.submit(function() {
            var action = $(this).find('[data-actions]').find(':selected');

            if (action.is('[data-confirm]')) {
                return confirm(confirmString);
            }

            return true;
        });

        $('form[data-confirm]').submit(function() {
            return confirm(confirmString);
        });
    </script>
@stop

@section('footer')
    @yield('forum_footer')
@stop

category.index which gets loaded after the forum.master

{{-- $category is passed as NULL to the master layout view to prevent it from showing in the breadcrumbs --}}
@extends ('forum::master', ['category' => null])

@section ('forum_content')
    @can ('manageForumCategories')
        @include ('forum::category.partials.form-create')
    @endcan

    <h2>{{ trans('forum::general.index') }}</h2>

    @foreach ($categories as $category)
        <table class="table table-index">
            <thead>
            <tr>
                <th>{{ trans_choice('forum::categories.category', 1) }}</th>
                <th class="col-md-2">{{ trans_choice('forum::threads.thread', 2) }}</th>
                <th class="col-md-2">{{ trans_choice('forum::posts.post', 2) }}</th>
                <th class="col-md-2">{{ trans('forum::threads.newest') }}</th>
                <th class="col-md-2">{{ trans('forum::posts.last') }}</th>
            </tr>
            </thead>
            <tbody>
            <tr class="category">
                @include ('forum::category.partials.list', ['titleClass' => 'lead'])
            </tr>
            @if (!$category->children->isEmpty())
                <tr>
                    <th colspan="5">{{ trans('forum::categories.subcategories') }}</th>
                </tr>
                @foreach ($category->children as $subcategory)
                    @include ('forum::category.partials.list', ['category' => $subcategory])
                @endforeach
            @endif
            </tbody>
        </table>
    @endforeach
@stop

Now, when I go to this page (url('forum') ), all policy checks return true. Which means I can see all the links I'm not supposed to. If I navigate off the main forum page, either deeper into the forum, or into the site itself, all policy checks work as intended.

Activity icon

Replied to All Policies Returns True On One Page Only

I'm not using any custom middleware, basically just what riari has out of the box. I modified the front end to work with my layout, but even then nothing I changed dealt with policy checking. I'm not sure what code I need to post at this point, but I'll happily post anything. This one is rather baffling.

Activity icon

Started a new Conversation All Policies Returns True On One Page Only

I go to my main forum index page, and I can see all the admin links. Yet clicking any other page, forum category,post, non-forum link, etc., those admin links disappear and all returns well. It's just on one page where all blade policy checks return true. It's rather annoying trying to troubleshoot. I'm not sure what the cause can be. If I dd() in blade with a user->can() check, everything returns true on the forum index page, but navigating away returns the answer it's supposed to give.

I setup a test user with no permissions or roles, I can't access any of the admin links. So permissions are working as expected for the site as a whole. I go to the forum page and all the permissions in the blade files return true. I can't access the page, so the backend php seems to be working as intended. This appears to be a blade/front end issue.

I'll gladly post whatever code I need to, but I'm not really sure where to start here.

Laravel 5.8

packages used:

Spatie/Laravel-permission
Riari/Laravel-forum
Riari/Laravelforum-frontend
Sep
11
5 months ago
Activity icon

Replied to Laracasts Coupons Codes?

If history is one to go by, it is unlikely that a coupon will be valid for a lifetime subscription.

Aug
21
5 months ago
Activity icon

Replied to Upgrade Laravel 5.3 To 5.8

Also, some of your packages might need to be updated as well. In your error the package elibyy/tcpdf-laravel is what is throwing the error. That version of the package needs laravel 5.3 to work.