Lordbedwetter

Member Since 2 Years Ago

Colorado Springs

Experience Points
41,730
Total
Experience

3,270 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
394
Lessons
Completed
Best Reply Awards
1
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.

  • Community Pillar

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

Level 9
41,730 XP
Mar
03
5 days ago
Activity icon

Awarded Best Reply on How To Pass Variable To Fortify's View?

Have you tried explicitly passing it into the view? Something like:

view('auth.register')->with('var', Var::all());
Activity icon

Replied to How To Pass Variable To Fortify's View?

Have you tried explicitly passing it into the view? Something like:

view('auth.register')->with('var', Var::all());
Activity icon

Replied to Display Product In Bootstrap Carousel Slide

Perhaps, try this solution https://stackoverflow.com/questions/42618351/use-pagination-for-limited-records-in-laravel-5-2

I'm not sure if it's changed since 5.2, but I don't believe the paginate method will work with the limit method out of the box

Feb
09
3 weeks ago
Activity icon

Commented on A Thread Should Be Assigned A Channel

If anyone is wondering how to override the Resource methods in the routes/web.php file, its pretty simple. Just declare the route before the Resource.

Route::get('/threads/{channel}/{thread}', [ThreadController::class, 'show']);
Route::resource('threads', ThreadController::class);
Feb
02
1 month ago
Activity icon

Commented on The Exception Handling Conundrum

For those of us who want to save time typing when testing individual tests, instead of typing: ./vendor/bin/phpunit --filter insert test name

I found it useful to add a permanent alias of "test" in my .bashrc file so it went from: ./vendor/bin/phpunit --filter CreateThreadsTest to test CreateThreadsTest

Maybe I took the long way around, and if so, please educate me, but this worked well for me.

Feb
01
1 month ago
Activity icon

Commented on A User May Publish Threads

At the end of the episode, I had another error. It could not find the exception I was looking for. I was able to solve this by using the following code:

public function test_a_guest_may_not_create_threads()
    {
        $this->withoutExceptionHandling();
        $this->expectException(AuthenticationException::class);
        $thread = Thread::factory()->create();

        $this->post('/threads', $thread->toArray());
    }

Hopefully, this also helps someone stuck while following along

Activity icon

Commented on A User May Publish Threads

In Laravel 8, I kept getting an error here:

  28▕         $response = $this->post('/threads', $thread->toArray());
     29▕
     30▕         $this->get($thread->path())
  ➜  31▕         ->assertSee($thread->title)
     32▕         ->assertSee($thread->body);
     33▕     }
     34▕ }

I solved this issue by changing:

    $thread = Thread::create([
            'user_id' => auth()->id,
            'title' => request('title'),
            'body' => request('body')
        ]);

to:

        $thread = Thread::create([
            'user_id' => Auth::id(),
            'title' => request('title'),
            'body' => request('body')
        ]);

Hope it helps someone.

Jan
31
1 month ago
Activity icon

Replied to Laravel Testing Not Pickup New Test Cases.

Coming in clutch with the thing that I can't believe I overlooked lol

Cheers!

Activity icon

Commented on A Thread Can Have Replies

Hopefully, I can redeem myself with my last ridiculous question with a piece of advice for anyone following along with Laravel 8. I have been getting an "Unknown formatter" error in regards to using faker within my factory. There are 2 solutions that I have found:

  1. Change
use PHPUnit\Framework\TestCase;

to

use Tests\TestCase;
  1. Instead of using Unit tests, use Feature tests.

Personally, I don't think it really matters, even though Unit tests are generally more specific to one piece of code (according to the docs), but as long as its testing the functionality, I don't see a big deal just using Feature Tests.

Hope this helps. It took me a good 20 minutes to figure it out.

** Sauce: https://github.com/laravel/framework/issues/34384

Activity icon

Commented on A Thread Can Have Replies

10 seconds later and I feel stupid....

Long day. Ignore my stupid question. Its too bad I can't delete this comment lol

Activity icon

Commented on A Thread Can Have Replies

I realize this is a few years old, but I am getting an error on:

{{ $reply->owner->name }}


Trying to get property 'name' of non-object (View: C:\xampp\htdocs\tdd-forum\resources\views\threads\show.blade.php)

Has this been removed or altered in the new versions of Laravel? Looks like my code is basically identical to the GitHub repo, but still an error.

Jan
27
1 month ago
Activity icon

Replied to LinkedIn Socialite Works On Localhost, But Not In Product

According to my error log on Forge, the error occurs:

[2021-01-26 04:09:18] production.ERROR:  {"exception":"[object] (Laravel\Socialite\Two\InvalidStateException(code: 0):  at /home/forge/rockymountainweb.design/vendor/laravel/socialite/src/Two/AbstractProvider.php:220)
Activity icon

Replied to LinkedIn Socialite Works On Localhost, But Not In Product

I have the same domain on LinkedIn. I made sure to make them the same before testing.

Jan
25
1 month ago
Activity icon

Started a new Conversation LinkedIn Socialite Works On Localhost, But Not In Product

In my local setup, I have no issues logging in with LinkedIn using Socialite, however, when I pushed it to production, I get a 500 server error after the LinkedIn login screen appears and I attempt to authenticate.

I have changed the domain in my session. php file:

'domain' => env('SESSION_DOMAIN', ".rockymountainweb.design"),

This is my Controller:

<?php

namespace App\Http\Controllers;

use Laravel\Socialite\Facades\Socialite;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;

class LoginWithLinkedInController extends Controller
{
     /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = '/dashboard';
 
    /**
     * Redirect the user to the Linkedin authentication page.
     *
     * @return Response
     */
    public function redirectToProvider($provider)
    {
        return Socialite::driver($provider)->scopes(['r_liteprofile', 'r_emailaddress'])->redirect();
    }
   
    /**
     * Obtain the user information from Linkedin.
     *
     * @return Response
     */
    public function handleProviderCallback($provider)
    {
        $user = Socialite::driver($provider)->user();
        $authUser = $this->findOrCreateUser($user, $provider);
        Auth::login($authUser, true);
        return redirect($this->redirectTo);
    }
   
    /**
     * If a user has registered before using social auth, return the user
     * else, create a new user object.
     * @param  $user Socialite user object
     * @param $provider Social auth provider
     * @return  User
     */
    public function findOrCreateUser($user, $provider)
    {
        $authUser = User::where('provider_id', $user->id)->first();
        if ($authUser) {
            return $authUser;
        }
        return User::create([
            'name'     => $user->name,
            'email'    => $user->email,
            'provider' => $provider,
            'provider_id' => $user->id
        ]);
    }
}

Routes:

Route::get('login/{provider}', [LoginWithLinkedInController::class, 'redirectToProvider']);
Route::get('{provider}/callback', [LoginWithLinkedInController::class, 'handleProviderCallback']);

My services.php file:


    'linkedin' => [
            'client_id' => env('LINKEDIN_CLIENT_ID'),
            'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
            'redirect' => env('LINKEDIN_CALLBACK_URL'),
        ],

From the view:

    <div class="inline-flex justify-center">
                    <p class="w-1/2 my-auto text-lg font-medium text-gray-700">
                        Sign in with:
                      </p>
                  <a href="{{ url('/login/linkedin') }}" class="inline-flex justify-center w-full px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50">
                    <span class="sr-only">Sign in with LinkIn</span>
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" viewBox="0 0 32 32" xml:space="preserve"><g id="OUTLINE_copy"><path fill="#414752" d="M23.247 21.927v-5.36c0-2.872-1.533-4.208-3.577-4.208-1.649 0-2.388.907-2.8 1.544v-1.324h-3.107c.041.877 0 9.348 0 9.348h3.107v-5.221c0-.279.02-.558.103-.757.224-.558.735-1.136 1.593-1.136 1.125 0 1.574.857 1.574 2.113v5.001h3.107zM10.49 11.303c1.083 0 1.758-.718 1.758-1.616-.02-.917-.675-1.614-1.738-1.614s-1.757.697-1.757 1.614c0 .897.675 1.616 1.717 1.616h.02zm1.553 10.624v-9.348H8.937v9.348h3.106z"/><path fill="#414752" d="M16 1c8.271 0 15 6.729 15 15s-6.729 15-15 15S1 24.271 1 16 7.729 1 16 1m0-1C7.163 0 0 7.163 0 16s7.164 16 16 16 16-7.164 16-16S24.836 0 16 0z" id="Shopping_10_116_"/></g><metadata><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Description about="https://iconscout.com/legal#licenses" dc:title="linkedin,social,media,online" dc:description="linkedin,social,media,online" dc:publisher="Iconscout" dc:date="2017-09-15" dc:format="image/svg+xml" dc:language="en"><dc:creator><rdf:Bag><rdf:li>Epicflaticon by Alfredo</rdf:li></rdf:Bag></dc:creator></rdf:Description></rdf:RDF></metadata></svg>
                  </a>
                </div>

Directly from LinkedIn: Authorized redirect URLs for your app https://rockymountainweb.design/linkedin/callback

Hopefully, someone can give me an idea of where I may be going wrong. As I said, it works perfectly in localhost and I have been unable to figure this out for several days and I'm out of ideas.

Regards,

Edward

Jan
23
1 month ago
Activity icon

Commented on Installation And Usage

Fantastic series brother. Thank you!

Jan
16
1 month ago
Activity icon

Awarded Best Reply on How To Manually Delete User In Jetstream

I feel like an idiot for even asking this question a few hours later. Sometimes, its easy to overcomplicate things and forget the basics. I'm still confused as to why I can manually create a password in the database and it wont be recognized in my application, but deleting the user was as easy as creating a new controller, route, and form to submit a POST request to with the authenticated user and calling the delete method.

As usual, this question can be filed under the "I'm embarrassed I even asked that question" folder of my programming journey. I'm sure I'm not the only one, but its worth saying for anyone who reads this, don't forget the basics

Activity icon

Replied to How To Manually Delete User In Jetstream

I feel like an idiot for even asking this question a few hours later. Sometimes, its easy to overcomplicate things and forget the basics. I'm still confused as to why I can manually create a password in the database and it wont be recognized in my application, but deleting the user was as easy as creating a new controller, route, and form to submit a POST request to with the authenticated user and calling the delete method.

As usual, this question can be filed under the "I'm embarrassed I even asked that question" folder of my programming journey. I'm sure I'm not the only one, but its worth saying for anyone who reads this, don't forget the basics

Jan
15
1 month ago
Activity icon

Commented on Customize Routes

Its impossible to explain how much you are helping me. Thank you so much for all the great work

Activity icon

Started a new Conversation How To Manually Delete User In Jetstream

I am currently implementing third party login with LinkedIn, Github, FB, etc, however, there are no passwords associated with these types of logins (to my knowledge), and therefor, I am unable to delete the user account from the dashboard, as it requires a password confirmation to do so.

For some reason, I am unable to even use a password with these types of account, even manually setting it in the database. Even though the password matches what is in the database, I get a "passwords don't match" error.

Has anyone else ran into this issue? I am a but stuck right now.

Jan
13
1 month ago
Activity icon

Replied to Getting ReCAPTCHA To Work

Coming in clutch my friend! Thanks!

Jan
09
1 month ago
Activity icon

Replied to Problem Installing SSL Certificate

3 years later and still coming in clutch! Thank you! I've been trying to figure out this problem for literally DAYS

Dec
26
2 months ago
Activity icon

Replied to Links Not Working With Livewire Pagination

I figured this out literally as I was about to walk out the door.

I am still getting used to using components and as a result, I accidently set my layout file up kind of goofy and ended up leaving out livewireScripts and livewireStyles on a page I did not extend my layout file to yet. Its amazing how easy it is to overlook something simple

Activity icon

Started a new Conversation Links Not Working With Livewire Pagination

HI there, I am currently working on a "simple" pagination feature for blog posts.

My problem: the correct amount of posts and pagination links appear (and according to how many records are in the database), but do not navigate/change the data on the page when clicked.

Here's what I've done:

  • Made sure there is only one root div on the livewire component.
  • Made sure the {{ $posts->links() }} is outside of the foreach loop.
  • Imported the Blog model into the Component class.
  • Made sure to use the WithPagination trait

I am a bit out of ideas. I have to leave for work now. I hope someone can help point me in the right direction so I can finish this "simple" feature when I get home.

Nov
12
3 months ago
Activity icon

Awarded Best Reply on How To Create Tailwind Utilities In Laravel

I have solved this issue. The problem was that I was not importing the css file into the app.css file. While the documentation on Tailwind's website shows you can write the css in between the imports, it does not work within the Laravel framework that way.

@import 'tailwindcss/base'; @import 'tailwindcss/components'; @import '../css/rocky.css'; @import 'tailwindcss/utilities';

worked with no issues to my knowledge.

Activity icon

Replied to How To Create Tailwind Utilities In Laravel

I have solved this issue. The problem was that I was not importing the css file into the app.css file. While the documentation on Tailwind's website shows you can write the css in between the imports, it does not work within the Laravel framework that way.

@import 'tailwindcss/base'; @import 'tailwindcss/components'; @import '../css/rocky.css'; @import 'tailwindcss/utilities';

worked with no issues to my knowledge.

Nov
11
3 months ago
Activity icon

Replied to How To Create Tailwind Utilities In Laravel

I literally tried to do that same thing the documentation showed. Just writing a class in between the components and utiltities like so:

@import 'tailwindcss/components';

.footer-link { @apply *tailwind classes---> ; } @import 'tailwindcss/utilities';

Activity icon

Started a new Conversation How To Create Tailwind Utilities In Laravel

EDIT* Literally 5 seconds after I posted this question, I tried the utility classes AFTER all of the imports, and it DOES work, however, as stated in the video on Tailwind's documentation, you cannot layer other classes if you do this, which is correct. That being said, if I put the utility class in between the imports as directed, it breaks tailwind and nothing works. So my question is still valid, but hopefully this extra context means something to someone who can help.

Can anyone explain how I go about creating Tailwind Utility classes in Laravel? Just using the documentation on Tailwind's website, it looks like I would create them in between the import for tailwindcss/components and the import for tailwindcss/utilities in the app.css file, however, I get an error every time I compile the assets.

Am I missing something obvious? I've been working for several hours and my mind is toast, but I'm also out of ideas.

Regards,

Edward

Oct
23
4 months ago
Activity icon

Awarded Best Reply on Trying To Move Login/Register Links From Welcome Page

After sleeping on it and going back, the issue is that I deleted {{.$slot }} from the guest layout. That's why the components never showed up, even though the page would load.

Admittedly, the whole concept is very confusing to me. It seems like a whole lot has changed since the previous versions and I'm really struggling to understand how everything is connected and working when Jetpack is involved.

Activity icon

Replied to Trying To Move Login/Register Links From Welcome Page

After sleeping on it and going back, the issue is that I deleted {{.$slot }} from the guest layout. That's why the components never showed up, even though the page would load.

Admittedly, the whole concept is very confusing to me. It seems like a whole lot has changed since the previous versions and I'm really struggling to understand how everything is connected and working when Jetpack is involved.

Activity icon

Replied to Trying To Move Login/Register Links From Welcome Page

  1. There are NO errors in the dev tools. This is not a HTML problem. There are no errors in loading assets, no console errors, no Laravel errors that appear on the screen.
  2. Clicking the link and/or manually typing it in only results in loading the url(http://127.0.0.1:8000/login), but getting the guest layout view. It does not load the login or register view.
Oct
22
4 months ago
Activity icon

Replied to Trying To Move Login/Register Links From Welcome Page

I literally deleted every line in the body tag with exception to the navigation, and inserted it into the guest view. The login GET request action is "Laravel\Fortify\Http\Controllers\[email protected]", however, I cannot locate that file.

The html and javascript are identical up until the body tag

Activity icon

Replied to Trying To Move Login/Register Links From Welcome Page

There are no errors. All my resources have loaded correctly as well. When I run php artisan route:list, I see that get requests from /login and /register are routed through a fortify controller, but this is all so new to me, I can't seem to track where the issue is.

Activity icon

Replied to Trying To Move Login/Register Links From Welcome Page

Its just the local server with the endpoints, just like in the welcome view

<a href="http://127.0.0.1:8000/login" class="text-sm text-gray-700 underline">Login</a>
     <a href="http://127.0.0.1:8000/register" class="ml-4 text-sm text-gray-700 underline">Register</a>

It works absolutely fine in the welcome view, but even if I cut and paste the entire markup, it doesn't work if I extend the guest layout view.

Activity icon

Started a new Conversation Trying To Move Login/Register Links From Welcome Page

I have recently started anew project with Jetstream and Livewire and am really struggling to understand what I am missing with my issue.

I am trying to move the default code: @if (Route::has('login')) @auth Dashboard @else Login

                    @if (Route::has('register'))
                        <a href="{{ route('register') }}" class="ml-4 text-sm text-gray-700 underline">Register</a>
                    @endif
                @endif
            </div>
        @endif

from my welcome.blade.php file, to the guest layout file and extend the guest to my welcome view with custom content. The links appear, however, when I click login or register, it keeps me on the same exact page and does not go to the register or login view. I've been trying to solve this on my own for a few hours and I'm honestly at a loss for why this is the case.

Can anyone explain what the reason for this is?

Oct
04
5 months ago
Activity icon

Replied to Jetstream/Livewire Slots On Layout Pages

Thank you everyone for all your suggestions. Apparently, I need to dive back into some more videos to fill in the gaps. I understand where I was going wrong and am miles ahead of just a few hours ago, but admittedly, its sometimes hard to keep up with everything,

Thanks again everyone

Activity icon

Replied to Jetstream/Livewire Slots On Layout Pages

I have read it. I am trying to experiment with the Jetstream components. I get an "Undefined variable: _instance" error when I add to the blade file

Activity icon

Started a new Conversation Jetstream/Livewire Slots On Layout Pages

I would be a liar if I said I wasn't overwhelmed by the changes that has come with Laravel 8 and the addition of Jetstream and Livewire. I am having a hard time wrapping my head around how this stack is supposed to work together.

Specifically, at this moment I am completely lost on the {{ $slot }} inserted on the layout blade files. How do I even set up a new page? I have been reading the docs on Jetstream, Livewire, and Laravel and have not found a clear answer.

How do I correctly add a slot to the guest and app layout files? Sorry if I am overlooking something simple, but I'm pretty stuck at the moment

Sep
17
5 months ago
Activity icon

Commented on How It Works

I absolutely LOVE this! I can't wait for more video lectures on how to master this. We really live in amazing times ha

Sep
09
5 months ago
Activity icon

Commented on Squash A Massive Migrations Folder

This is such a nice feature! I could have really used it on a previous project

Activity icon

Commented on Preparing For Laravel 8

You are much appreciated