dmcglone27

Member Since 4 Years Ago

Experience Points
57,430
Total
Experience

2,570 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
532
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.

  • Community Pillar

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

Level 12
57,430 XP
Jun
04
1 week ago
Activity icon

Replied to Upload

I don't know how to mark the thread as solved.

Activity icon

Replied to Upload

I got it figured out, I needed an .htaccess file.

Activity icon

Replied to Upload

Ok I have found what the problem is... If I point the URL to the public folder, it works. It sounds like I need an htaccess file, but I don't know how I would do an htaccess file.

Activity icon

Replied to Upload

If I use softacious to install laravel it works fine, but if I upload using git, I get a 403 forbidden!

Forget about my original question, that happens when I use softacious, but I don't want to use softacious because when I upload changes everything breaks.

I got a fresh install of laravel and uploaded it via git and I have made sure the storage folders have the correct permissions and I have did a composer update and all I get is "403 you do not have permission to access this resource".. But It works just fine on my machine. I also make sure the key was generated. Still only get a 403

Activity icon

Started a new Conversation Upload

When I upload laravel using git to my webserver and visit the site, laravel tells me it was successfully installed shows me a 5 second redirect timer and then tries to redirect me to my own computer. Why does it do this and how can I fix it?

May
14
4 weeks ago
Activity icon

Replied to GET Method Not Supported

Thank you and everyone here for the help and feedback..

I'm not worrying too much about the time I've spent on this, because it's more less for learning. I think I've been working on the same code base for a couple months now.

After you made it clear I shouldn't be worried about a couple extra lines, it did help me realize I was worried about dumb stuff...Here's what I have come up with and it works great.


Route::group([
    'namespace' => 'Dashboard',
    'prefix' => 'dashboard'
], function () {

    Route::resource('/', 'DashboardController');

    Route::get('/meetings/create', '[email protected]');
    Route::get('/meetings/store', '[email protected]');
    Route::get('/meetings/{id}/edit', '[email protected]');
    Route::patch('/meetings/{id}', '[email protected]');
    Route::delete('/meetings/{id}', '[email protected]');

});

Route::resource('/meetings', 'Dashboard\MeetingsController')->except(['create', 'store', 'edit', 'update', 'delete']);

May
12
1 month ago
Activity icon

Replied to GET Method Not Supported

I tried that, that's when I got the error. If what I tried is what you are referring to. Here's what I've done. Is this the way your referring to?

Routes file

Route::group([
    'namespace' => 'Dashboard',
    'prefix' => 'dashboard'
], function () {

    Route::resource('/', 'DashboardController');

//All the dashboard/meetings routes.

    Route::resource('/meetings', 'MeetingsController')->except('index', 'show'); 


});

All the /meetings routes.

Route::resource('/meetings', 'Dashboard\MeetingsController')->only(['index', 'show']);

MeetingsController

 public function index()
    {

        $meetings = Meeting::with('location')->orderBy('date', 'desc')->get();

        return view('pages.meetings.index', compact('meetings'));

    }

Activity icon

Replied to GET Method Not Supported

Ah, I never thought of it that way.

Activity icon

Replied to GET Method Not Supported

but what happens when the project grows?

Activity icon

Replied to GET Method Not Supported

sounds about right.. lol

Activity icon

Replied to GET Method Not Supported

Sounds easy enough, I was thinking there'd be a better way than having a whole lot of individual routes. :-(

Activity icon

Replied to GET Method Not Supported

Right, and I don't want to. I want to hide, suppress any errors with a 404 or simply redirect to /dashboard in case someone tries to visit that URL

Activity icon

Replied to GET Method Not Supported

Looking this over and I'm a bit confused.

Activity icon

Replied to GET Method Not Supported

I don't want index to show up in /dashboard/meetings.. I only want /dashboard/1/edit, /dashboard/create.... etc..

Activity icon

Replied to GET Method Not Supported

I disabled it because I don't want to use it and I'm searching for a way to disable it so anyone who might try and visit that page will get a 404 page not found or something.

Activity icon

Started a new Conversation GET Method Not Supported

When I disable debugging, use except on the meetings resource and visit the URL (dashboard/meetings) to make sure it doesn't work, I get a '405 method not allowed'.

When I enable debugging, I get

"The GET method is not supported for this route. Supported methods: POST."

how should I handle this?


Route::group([
    'namespace' => 'Dashboard',
    'prefix' => 'dashboard'
], function () {

    Route::resource('/', 'DashboardController');
    Route::resource('/meetings', 'MeetingsController')->except('index', 'show');


});

May
10
1 month ago
Activity icon

Replied to Namespacing

Thank you. I think this was a much better question/answer and exactly what I was looking for. This makes me wonder if I should be doing it like this because it doesn't feel right to me for some reason.

Activity icon

Replied to Namespacing

I agree. I shouldn't have deleted it.

I've been doing a lot of trial and error so I can post a better more concise question.

My question isn't namespacing, it's how to get the index and show methods out of the namespace. So in my URL for the edit and create is /admin/meetings/1/edit and the URL for the index is /meetings..

Hopefully that makes sense.

routes.php

Route::group([
    'namespace' => 'Admin',
    'prefix' => 'admin',
    'middleware' => 'auth'
],
    function () {

        Route::resource('/', 'AdminController');

        Route::resource('/meetings', 'MeetingsController');
    });

Is it possible? Would I need to create another route for the index and show pages outside the namespace?

I feel if I have to create a seperate route, it defeats the purpose of the route resource.

Activity icon

Replied to Namespacing

I deleted it because I felt like it was a dumb question after I figured out my mistake. :-(

Activity icon

Replied to Namespacing

Thank you.

Activity icon

Started a new Conversation Namespacing

Delete the question I got it.

Mar
11
3 months ago
Activity icon

Replied to Routes

I just punched myself!

Activity icon

Started a new Conversation Routes

I spent all day looking for a video where Jeff explains the way routes changed in laravel 7 or 8 and how to write them and I can't find anything. I remember something like this:

use App\Http\Controllers\WelcomeController;

Route::get('/', WelcomeController::class, 'index');

This don't work of course.

Dec
23
5 months ago
Activity icon

Replied to Gmail Smtp

Ok I'll check into that. I have many other apps that access's my google so I assumed I was good on that part.

Activity icon

Started a new Conversation Gmail Smtp

What are the settings for gmail's smtp. I've tried every setting and I can't get mail to send.

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=2525 
[email protected]
MAIL_PASSWORD=myPassword
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

I've tried 465/ssl and 587/tls And I can't get mail to send.

Activity icon

Replied to I'm Completely Lost On This One.

You're correct it is a collection and your solution worked.. Thank you.

Activity icon

Started a new Conversation I'm Completely Lost On This One.

Why isn't this working.. I'm completely puzzled. What the heck?

This displays "View all events" whether there are events or not in the DB.

@if(!$events)
    <h4 style="color: white;">There or no events at this time.</h4>
 @else
    <span><a href="events" class="subheading">View All Events</a></span>
  @endif

Change it to this and it displays "There or no events at this time." whether there are event's or not in the DB

@if($events)
<h4 style="color: white;">There or no events at this time.</h4>
 @else
    <span><a href="events" class="subheading">View All Events</a></span>
  @endif

Change it to and it displays "View All Events" whether there are event's or not in the DB

@if(empty($events))
<h4 style="color: white;">There or no events at this time.</h4>
 @else
    <span><a href="events" class="subheading">View All Events</a></span>
  @endif


@if(!empty($events))

And vise versa, so on and so forth... I'm puzzled!

Dec
15
5 months ago
Activity icon

Replied to Combine Roles

That's it! Thanks. Now I've got to work at understanding this!

Dec
14
5 months ago
Activity icon

Replied to Combine Roles

Ok.. taking a closer look, this code does work, but it removes the word "members" not the profile of members.

Activity icon

Replied to Combine Roles

Well well well, thank you.. I had this exact same thing before I got what I have above, BUT i was using != like this

$users = User::with(['roles' => function ($query) {
    $query->where('name', '!=', 'members'); 
}])->get();

Can I ask why you used '<>' instead?

And thank you for the help, I appreciate it. :-)

Activity icon

Replied to Combine Roles

Thank you. I had something similiar but it wasn't a good solution for me because I don't want to fetch any roles with the name 'member'.

What I have works great, but if 1 person has more than 1 role, that person appears on the page multiple times for each role, instead of displaying just once with their perspective roles.

I hope that makes sense.

Activity icon

Started a new Conversation Combine Roles

I'm looking for a solution and suggestions to combining the users roles if they happen to have more than one role so there isn't multiple records on the page...

This is what I've come up with so far. Would it be better to store multiple roles in the same db row as the user instead of one record per role? My db schema is below.

Controller

$getRoles = Role::all();

        $userRoles = User::whereHas('getRoles', static function ($query) use ($getRoles) {
            return $query->whereIn('name', $getRoles);
        })->get();


View

@foreach($userRoles as $user)
                    @foreach($user->getRoles as $role)
                        @if($role->name != 'members')
                            <div class="col-md-6 col-lg-3 ftco-animate">
                                <div class="staff">
                                    <div class="img-wrap d-flex align-items-stretch">
                                        <div class="img align-self-stretch"
                                             style="background-image: url(images/staff/{{ $user->img }}); background-size: 250px 320px"></div>
                                    </div>
                                    <div class="text d-flex align-items-center pt-3 text-center">
                                        <div>
                                            <h3 class="mb-5">{{ $user->name }}</h3>
                                            <span class="position mb-4">{{ $role->name  }}</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        @endif
                    @endforeach
                @endforeach

role_user_table

Schema::create('role_user', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')->unsigned();
            $table->bigInteger('role_id')->unsigned();
            $table->timestamps();

            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade');
        });

roles_table

Schema::create('roles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name');
            $table->string('label')->nullable();
            $table->timestamps();

Dec
08
6 months ago
Activity icon

Replied to Laravel 8 Style

Ah ok, my understanding is all jumbled around at the moment, but I figured out where a lot of my confussion was..... The Welcome page on a fresh install of Laravel 8 is using tailwind, but the auth package is using bootstrap. That was completely unexpected and threw me off so bad, I didn't even think to look at the code of the login page to see it is using bootstrap.

Activity icon

Replied to Laravel 8 Style

I found that when I moved the CSS folder, it was bootstrap on the auth pages that was working, but laravel itself is using tailwind.

I'm gonna try again some other time, because somehow all that made my head spin.

Activity icon

Replied to Laravel 8 Style

I'll just stick to Bootstrap for the time being, I just thought Id give it a go and see what it was all about.

Activity icon

Replied to Laravel 8 Style

I followed these instruction and got an error that I posted below. :-(

Activity icon

Replied to Laravel 8 Style

I understand, I just thought I'd give it a try and see if I liked it better than bootstrap

Activity icon

Replied to Laravel 8 Style

I used this command: laravel new my-app --jet

to start a new project with tailwind, set up the db and plugged in the info in .env and I get this.


  SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = tailwind and table_name = migrations and table_type = 'BASE TABLE')

``
Activity icon

Replied to Laravel 8 Style

True. I'm open to either way, I just need to know how it all comes together with all these changes.

Activity icon

Replied to Laravel 8 Style

Is this all I have to do to use tailwind in a new project?

laravel new my-app --jet

Activity icon

Replied to Laravel 8 Style

Well dang! Now I'm all confused..

Activity icon

Replied to Laravel 8 Style

I found the CSS folder was in the resources folder, so I moved it to public and now it works.. That was weird.. Anyone know know what's up with that?

Activity icon

Started a new Conversation Laravel 8 Style

Just installed Laravel 8 with auth to familiarize myself with it and the login page has no styles and I can't figure out why. I installed bootstrap, but the code in the login page doesn't look like bootstrap. What have I missed?

So far this has been a pain in the butt.

Activity icon

Replied to Fanzino Faker Mbnumber

Ok I kinda thought I could format it later. Thank you.

Activity icon

Started a new Conversation Fanzino Faker Mbnumber

i can't find any explanation on how to include the trailing zeros in faker for example, I'm using the following


'price' => $this->faker->randomFloat($nbMaxDecimals = 2, $min = 0, $max = 40),

but when I have a dollar amount that ends in a zero, it cuts it off. for example: $4.6 instead of $4.60

I have figured out nbMaxDecimals moves the decimal point to the left that many places, but I can't find an explaination for anything else.

Dec
07
6 months ago
Activity icon

Replied to Can't Get Laravel

Thank you :-)

Activity icon

Started a new Conversation Can't Get Laravel

[email protected]:~/www/sites$ laravel new wicked
Crafting application...

In RequestException.php line 111:
                                                                                                                      
  Server error: `GET http://cabinet.laravel.com/latest.zip` resulted in a `522 Origin Connection Time-out` response:  
  <html>                                                                                                              
  <head><title>522 Origin Connection Time-out</title></head>                                                          
  <body bgcolor="white">                                                                                              
  <center><h1>522 Origin Conne (truncated...)                                                                         
                                                                                                                      

new [--dev] [--auth] [-f|--force] [--] [<name>]

Dec
06
6 months ago
Activity icon

Replied to Seeder

Solved! I needed to dump composer.

Activity icon

Started a new Conversation Seeder

Is this seeder correct? Or how do I seed my db with the names of all the groups? At the moment just Women and Men..


 Group::create([
          $group = Group::create(['name' => 'women', 'description' => 'A group for women\'s fellowship']);
        $group = Group::create(['name' => 'men', 'description' => 'A group for men\'s fellowship']);
        ]);