purposemedia

purposemedia

Member Since 5 Years Ago

Experience Points 37,480
Experience Level 8

2,520 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 406
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.

07 Nov
10 months ago

purposemedia left a reply on Many-to-Many Relation Not Working Properly

You a just creating an instance of a class, not getting not a tournament model;

Tournaments::with('users')->all()->each(function($tournament){
    dump($tournment->users);
});

||

Tournaments::with('users')->findOrFail($tounamentId)->users->each(function($user){
    dump($user);
});

purposemedia left a reply on If IsActive Middleware Return False I Can't Login With Different User Until Delete Cookies

did you copy all the above code, not just adding the last line?

purposemedia left a reply on Artisan Slow To Boot In Iterm

What about your console kernel, anything being load in there?

purposemedia left a reply on Artisan Slow To Boot In Iterm

Comment out your application\route\event service provider in config/app.php and run again. Any difference in speed?

purposemedia left a reply on Display Form Errors Only Within A Certain Form

Send a hidden input field/value along with the submission, that way you know which form the request came from.

{{ old( 'form' ) == 'login' && $errors->has( 'email' ) ? $errors->first( 'email' ) : '' }}
<input type="hidden" name="form" value="login" />

..
...
..


{{ old( 'form' ) == 'register' && $errors->has( 'email' ) ? $errors->first( 'email' ) : '' }}
<input type="hidden" name="form" value="register" />

purposemedia left a reply on Multiple Checkbox Responses

If theres only one option after selecting multiple then your html is incorrect (missing '[]').

<input type="checkbox" name="thing[]" value="1" />
<input type="checkbox" name="thing[]" value="2" />
<input type="checkbox" name="thing[]" value="3" />

purposemedia left a reply on If IsActive Middleware Return False I Can't Login With Different User Until Delete Cookies

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class IsActive
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (Auth::check()) {
          if (Auth::user()->isActive()) {
            return $next($request);
          }
          return redirect('/')->with('nonActive', 'Налог није активан');
        }
        return $next($request);
    }
}

and make sure its being pulled in after the auth middleware

24 Aug
3 years ago

purposemedia left a reply on Access/Set Sessions In Global Middleware

cant believed I missed this... just added the middleware to the "middlewareGroups/web" stack instead of the "middleware" stack... jesus!

purposemedia left a reply on Access/Set Sessions In Global Middleware

I've built a modular based CMS, separated by a front application and a separate backend application. The front end could have up to 35+ modules, altering all routes in all these modules simply to get access to the session seems a bit extreme, surly theres a way to instantiate the session logic more simply from a global route.

23 Aug
3 years ago

purposemedia started a new conversation Access/Set Sessions In Global Middleware

Evening, is it possible to access/set sessions in a global middleware since the session is only accessed via a route middleware?

Trying to make a very simple passphrase middleware for staging sites and I dont want to make a route middleware as it would take a dogs age to update all our modules routes with a route middleware:

<?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;

class AccessProtection 
{

    /**
     * [handle description]
     * @param  [type]  $request [description]
     * @param  Closure $next    [description]
     * @return [type]           [description]
     */
    public function handle( $request, Closure $next )
    {

        if( ! app()->environment( 'production' ) ) {

            /** Checks for a submission for access to the site */
            if( ! is_null( $response = $this->checkForAccessRequest( $request ) ) ) return $response; 
            /** Checks to see if access has already been granted */
            if( ! is_null( $response = $this->checkForAccessPermission() ) ) return $response; 

        }
        return $next( $request );
    }

    /**
     * [checkForAccessPermission description]
     * @return [type] [description]
     */
    protected function checkForAccessPermission()
    {
        if( ! session()->has( 'access_permission' ) ) {
            return response()->make( view( 'global.permission' , [ 'error' => false ]), 401 );
        }
    }

    /**
     * [checkForAccessRequest description]
     * @param  [type] $request [description]
     * @return [type]          [description]
     */
    protected function checkForAccessRequest( $request )
    {
        if( $passphrase = $request->input( 'passphrase' ) ) {
            if( strcmp( $passphrase, env( 'PASSPHRASE', 'test' ) ) !== 0 ) {
                return response()->make( view( 'global.permission' , [ 'error' => 'Sorry passphrase was incorrect' ]), 401 );
            }
            $request->session()->put( 'access_permission', true );
        }
    }

}

06 May
3 years ago

purposemedia started a new conversation Database Connection - Unable To Load Key

Im pulling my hair out with this one. I've managed to get a site running on Digital Ocean through Forge and also SSH into the server so I know that the SSH keys are setup correctly.

But when trying to connect via Navicat, I keep getting the error "Unable to load key". Does anyone know what this is in reference to or what the problem is.

regards

04 May
3 years ago

purposemedia started a new conversation Using Gulp-rgbapng With Elixir

Hi,

im having a problem getting this module working with Elixir and was wondering if someone could point me in the right direction. I have no errors, it simply is not working:

elixir.extend( 'rgba', function() {
    new Task( 'rgba', function() {
        gulp.src( 'resources/assets/sass/**/*.scss' ).pipe( rgbapng() );
    });
});
elixir( function( mix ) {
    mix
    .rgba()
    .sass();
});

regards

03 May
3 years ago
30 Apr
3 years ago

purposemedia left a reply on MessageBag Error On Array Validation

<div class="two fields">
    <div class="field">
        <label>First name:</label>
        {!! Form::text( "first_name[{$cartRow->id}][{$i}]" ) !!}
    </div>
    <div class="field">
        <label>Surname name:</label>
        {!! Form::text( "surname[{$cartRow->id}][{$i}]" ) !!}
    </div>
</div>
29 Apr
3 years ago

purposemedia started a new conversation MessageBag Error On Array Validation

HI,

I'm trying to return custom messages from an array validation but whatever I try I get an error thrown in the MessageBag class in regards to array to string conversion.

These are my errors:

The first_name.57.1 field is required.
The first_name.57.2 field is required.
The contact_number.57.1 field is required.
The contact_number.57.2 field is required.
The address_line_1.57.1 field is required.
The address_line_1.57.2 field is required.
The town.57.1 field is required.
The town.57.2 field is required.
The county.57.1 field is required.
The county.57.2 field is required.
The postcode.57.1 field is required.
The postcode.57.2 field is required.

and the message override on the request is:

public function messages()
{
    return [
        'first_name.*.*' => [
            'required' => 'sdsdsds'
        ]
    ];
}

any help is grateful