MikePage

Member Since 7 Months Ago

Experience Points
3,520
Total
Experience

1,480 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
32
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 1
3,520 XP
Mar
01
1 month ago
Activity icon

Started a new Conversation How To Create A Laravel Backpack Custom Button With Livewire

I am trying to make a custom button with livewire but can't get it to work

here is my button blade file

@once
  @push('befor_styles')
  <livewire:styles/>
  @endpush
@endonce

@livewire('component')

@once
  @push('after_scripts')
    <livewire:scripts/>
  @endpush
@endonce

Here is my livewire blade file

<button wire:click="connect" class="btn btn-sm btn-link m-0 text-danger">Connect</button>

And the php

public function connect()
    {
        $this->message = 'connected';
    }

When I click on the button nothing happens. There are no ajax requests being made.

have also tried

<livewire:styles/>

@livewire('component')

<livewire:scripts/>

This creates an ajax request when the page loads but nothing happens when the button is clicked.

I am using laravel 8 and PHP 7.4

Feb
05
2 months ago
Activity icon

Awarded Best Reply on Testing With Backpack

I have worked it out I needed to log the backpack user in. here is the finale test

public function create_scheduled_session()
    {
        \Session::start();
        $this->withoutExceptionHandling();

        $user = User::factory()->make([
            'password' => 'password',
            'id' => 1]);

        backpack_auth()->login($user);

        $session = ScheduledSession::factory('App\ScheduledSessions')->raw();

        $attributes = $session;
        $attributes['_token'] = csrf_token();

        $response = $this->post('admin/scheduled_sessions', $attributes);

        $response->assertStatus(200);

        $this->assertDatabaseHas('scheduled_sessions', $session);
    }
Activity icon

Replied to Testing With Backpack

I have worked it out I needed to log the backpack user in. here is the finale test

public function create_scheduled_session()
    {
        \Session::start();
        $this->withoutExceptionHandling();

        $user = User::factory()->make([
            'password' => 'password',
            'id' => 1]);

        backpack_auth()->login($user);

        $session = ScheduledSession::factory('App\ScheduledSessions')->raw();

        $attributes = $session;
        $attributes['_token'] = csrf_token();

        $response = $this->post('admin/scheduled_sessions', $attributes);

        $response->assertStatus(200);

        $this->assertDatabaseHas('scheduled_sessions', $session);
    }
Activity icon

Started a new Conversation Testing With Backpack

I am new to testing. I am using Laravel Backpack I am trying to test a method in a controller that takes 3 inputs and adds them to the db but the test is being redirected to the logging page and I don't understand why. Here is the test

public function create_scheduled_session()
    {

        $this->withoutExceptionHandling();

        \Session::start();
        
        $this->actingAs(User::factory()->make([
            'password' => 'password',
            'id' => 1]));

        $this->assertAuthenticated($guard = null);

        $attributes = ScheduledSession::factory('App\ScheduledSessions')->raw();
        $attributes['_token'] = csrf_token();

        $response = $this->post('admin/scheduled_sessions', $attributes);
        $response->dumpSession();
        $response->dumpHeaders();
        $response->assertStatus(204);

        $this->assertDatabaseHas('scheduled_sessions', $attributes);
    }

Is there anyone that could help me with this please I have been struggling with is for a couple of days now.

Oct
16
5 months ago
Activity icon

Awarded Best Reply on 500 Error On Al Routes But '/' Laravel 8

It's fixed. It turns out that I needed to add the following

RewriteBase /

Before line 6 in the .htaccess file in public.

Thank you everyone for your help.

Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

It's fixed. It turns out that I needed to add the following

RewriteBase /

Before line 6 in the .htaccess file in public.

Thank you everyone for your help.

Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

@snapey

Its not a Laravel page.

Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

@sinnbeck

I'm going to give them a call today. The only thing that is making me think it's not the sever, is that I am getting the same problem on AWS and Digital Ocean to.

Oct
15
5 months ago
Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

Here it the .htacces in the public folder

  <IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
      Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

@sinnbeck Just added a get and still got the 500

Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

Hi I have added a log entry and it is working fine.

Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

Here are my routes:

Route::get('/', [BodyStatsController::class, 'index'])->name('body_stats.index');

Route::post('/result', [BodyStatsController::class, 'result'])->name('body_stats.result');

Route::post('/save', [BodyStatsController::class, 'save'])->name('body_stats.save');

Oct
14
5 months ago
Activity icon

Replied to 500 Error On Al Routes But '/' Laravel 8

Changed the permissions. Still have the issue Sorry

Activity icon

Started a new Conversation 500 Error On Al Routes But '/' Laravel 8

Hi All

I have been trying to figure this out since the weekend. I have a small Laravel 8 app that I am trying to deploy to Ionos 1&1. the /' route works fine but any other throughs a 500 error.

My project folder permissions 777. My storage folder and all folders below are 707and all the files are 606

I cant see and info on the laravel.log.

I have tried cache:clear and config:clear, and done composer.phar dump-autoload.

I have not found any other solutions.

I hope someone can help me out with this one.

Thanks Michael