megaman

megaman

Member Since 4 Years Ago

Experience Points
2,695
Total
Experience

2,305 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
0
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.

Level 1
2,695 XP
Jun
01
1 day ago
Activity icon

Started a new Conversation Multiple Instances Of Laradock Conflicting Databases.

I have a existing project with its own laradock instance which uses mysql. I just started a new project with its own laradock instance.

whenIi first ran the second instance of laradock the database from the first instance was on the server. I expect this is because its stored on a volume so it is not lost when you use docker down.

however after running my migrations in the second project the first projects database has vanished no matter which instance of laradock i run only the second projects database appears.

both projects have different database names.

why has this happened?

Mar
10
2 months ago
Activity icon

Started a new Conversation Route Not Working

I have the following route

Route::group(['middleware' => ['auth:api']], function () { Route::get('submissions/search_by_date', 'Api\[email protected]_with_date_range')->name('api.submissions.search_by_date'); });

And i have the following function in Api\SubmissionController

public function submissions_with_date_range($start_date,$end_date){
    return 'blank';
}

Yet when i run the following code from a test with xdebug on the submissions_with_date_range function does not run

    $this->getJson(route('api.submissions.search_by_date'), [
        'Authorization' => 'Bearer '.$user->api_token
    ]);

It also does not run if i comment out the group in the route (so authentication is not needed) and go direct to submissions/search_by_date in my browser

why is this

Feb
24
3 months ago
Activity icon

Started a new Conversation Problem With Maatwebsite / Laravel-Excel

I am trying to use Maatwebsite/Laravel-Excel to generate spreadsheets.

my code works locally

However when i run it on the test server i get this error Interface 'Maatwebsite\Excel\Concerns\fromArray' not found

I have made sure the server has the same version of Maatwebsite/Laravel-Excel (3.1.18) as my local environment I have tried adding "Maatwebsite\Excel\ExcelServiceProvider::class" to my providers list (so i am not rellying on package auto-discovery) and "Maatwebsite\Excel\Facades\Excel::class" to my alias list. I have run composer dump-autoload and artisan cache:clear

nothing has fixed it

what else can i try?

Feb
17
3 months ago
Activity icon

Started a new Conversation Phpunit THE ERROR HANDLER HAS CHANGED!

I recently upgraded from laravel 5.8 to 6.15 including upgrading php to 7.3 and all of the packages to the newest or recent versions.

I am using laradock.

phpunit is at 8.5.2

My tests now all appear to pass (with a few "W",s but no "E",s) and on the next line it outputs "THE ERROR HANDLER HAS CHANGED!" in a red banner.

The usual summary which is displayed at the end (total number of tests, total pass ect) does not appear.

Nothing appears in any of my laradock logs when this happens I have had no luck googling the error.

does anyone know what causes this.

Jan
31
4 months ago
Activity icon

Started a new Conversation GroupBy Function

Does the eloquent groupBy function have the effect of splitting database rows into their own arrays when you convert the eloquent object to a collection using get() (or some other function)

ie would a collection of database rows which looks like this without groupBy()

[ row, row, row, row ]

become this if groupBy is used

[ [ row, row ], [ row, row ] ]

Jan
25
4 months ago
Activity icon

Replied to Gates

the current logic is return !!($user->api_token);

this returns a 1 and it does not authenticate

1 is usually accepted as an alternative to a true

and the fact that it was put there by a previous developer implies that it worked before or on a different system

do you know why it isnt working?

could the 1 be a string rather than an int? could it be a php setting? could it be a change in laravel since the code was written

Activity icon

Replied to Gates

i have done some experemending

my SubmissionPolicy->create() function has the following return statement

return !!($user->api_token);

if i replace this with ' return true; ' it grants access if i replace it with ' die ( !!($user->api_token) ) ' it prints 1 to the response

this suggests that previously (when a different developer was working on it )the gate accepted 1 as an alternative to true and now it is not.

could this be due to a change in laravel? could it be due to a change in laradock? could it be due to a php setting?

what can i do about this?

Activity icon

Replied to Gates

I found SubmissionPolicy->create() but what determines if the user has the create ability?

how do i give the user the create ability

Jan
24
4 months ago
Activity icon

Started a new Conversation Gates

I am looking through the codebase of an existing project, and inside one of the controllers, at the very top is this line

$this->authorize('create', new Submission);

$this->authorize is set in the extended controller class and is an instance of AuthorizesRequests which returns app(Gate::class)->authorize($ability, $arguments)

so it appears to be a gate which authorizes the user if the have the create ability

i have also looked thought this documentation https://laravel.com/docs/5.1/authorization

i am correct to believe that in order for the code to get past the $this->authorize('create', new Submission); line i need to a user who has the 'create' ability?

if yes

how do i give my user this ability?

if no

what is going on?