bearcodi

Member Since 4 Years Ago

Canberra

CTO at RedHub Pty Ltd

Experience Points 67,490
Experience Level 14

2,510 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 765
Lessons
Completed
Best Reply Awards 4
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.

21 Jul
1 month ago

bearcodi left a reply on Activity Streaks: How To Return ONLY Collection Of Carbon Objects From Query Scope?

You just need to use the collections pluck() method on your answered_at column prior to calling values()

$tableDates = Table::answeredByUser($user)
                ->get(['answered_at'])
                ->pluck('answered_at')
                ->values();

This will return a Collection of just the answered_at values, then you still have all the special sauce of Collection methods to play with, or if you just need the raw array you can just append the toArray() method.

Cheers

bearcodi left a reply on My Local Server Address After Php Artisan Serve 127.0.0.1:8000

In your routes file add a route that redirects to the default path you want.

Route::get(‘/‘, function() {
    return redirect(‘/student’);
});
20 Jul
1 month ago

bearcodi left a reply on Which Editor Do You Use To Work?

VS Codium or Atom, switch between both atm

bearcodi left a reply on Tailwind @apply In My Vue Components Styles Block

Have your tried applying the postcss language to the style tag?

<style lang=“postcss”>
      ...
</style>

This should run the style content through PostCss, assuming youre using Laravel mix and have registered tailwind in the PostCss plugins.

18 Jul
1 month ago

bearcodi left a reply on Import Csv In Laravel In Japanese Language

You will need to convert the contents character encoding after the call to file_get_contents as the PHP method uses the system locale setting.

So you would need to pass the file content through mb_convert_encoding do something like this:


$content = file_get_contents('japanese.csv');

$converted = mb_convert_encoding($content, 'UTF-8', 'EUC-JP');

$rows = array_map('str_getcsv', explode("\n", $converted));

var_dump(array_filter($rows));

Which provides the correct output:

array(4) {
  [0]=>
  array(2) {
    [0]=>
    string(6) "ああ"
    [1]=>
    string(6) "嗚呼"
  }
  [1]=>
  array(2) {
    [0]=>
    string(6) "あい"
    [1]=>
    string(3) "相"
  }
  [2]=>
  array(2) {
    [0]=>
    string(6) "あい"
    [1]=>
    string(3) "愛"
  }
}

Note my example CSV file is EUC-JP encoded, see the list of available encodings.

PHP manual for mb_convert_encoding.

Hope this helps!

bearcodi left a reply on After Assign A Data Property Equal To A Props Returns Null..

I tried your code out and your component is fine.

I've whipped up a sandbox to show the result, are you sure your binding your array to the component correctly?

https://codesandbox.io/s/vue-template-gn66g

bearcodi left a reply on In Shared Hosting Environment, How To Hide .env File From Public?

Have you changed the location of the .env file?

A default Laravel install has the .env file located one level up from the public folder and by default shouldn't be accessible.

  laravel\
      -> .env
      -> public\

You might need to check your nginx/apache configuration and check that the web root is public.

Can you provide your nginx/apache host file?

bearcodi left a reply on Exception Handling And Monolog Good Examples

Hi

Its actually a pretty easy solution as Laravel provides customising the exception handler easily.

I've created a sample application for you to have a look at:

https://github.com/bearcodi/laravel-exception-handling-fun

Check out the README.md file for an explanation, hope this helps explain the concept and is along the lines of what your looking todo!

Cheers

17 Jul
1 month ago

bearcodi left a reply on Is A Web Single Application Less Indexed For Google ?

Hi,

This is a good article that will help you get to your answer: https://medium.com/js-dojo/is-my-single-page-app-seo-friendly-be2c827f1c38

In summary, seems like google has kept up with the times (who knew) and the google bot will wait 20 seconds before timing out to allow for asynchronous calls.

Do looks like as long as your page load time is under 20 seconds, and the page does not require an authenticated user, you should be ok.

You could also try looking at implementing Server Side Rendering, checkout https://github.com/spatie/server-side-rendering

bearcodi left a reply on Call To Undefined Relationship [user] On Model [App\Quote].

Hi,

Looks like you have a typo in your Quote model.

Currently your relation for user is pluralized:

<?php
...
class Quote extends Model
{
    ...
    public function users()
    {

        return $this->belongsTo(User::class, 'id');

    }
    ....
}

That's why you're getting an exception when attempting to access the name attribute on $quote->user as the relation on the Quote model doesn't exist.

Try changing it to:

<?php
...
class Quote extends Model
{
    ...
    public function user()
    {

        return $this->belongsTo(User::class, 'id');

    }
    ....
}

You should then be able to access $quote->user->name in your blade templates.

Cheers

16 Jul
1 month ago

bearcodi commented on Avoid Flags

I can see your point of view on the IDE side of things, but sometimes I like to jump between IDEs or VIM and prefer not to rely on IntelliSense stuff as a requirement for coding.

This is were @jeffreyway suggestion leads to a nicer reading of the code.

Also, it then allows you to TDD out the length of the temporary delay, or do complex stuff like every time they get muted the delay is increased.

21 Feb
1 year ago

bearcodi left a reply on Issues With Consuming Own API Authenticated With Laravel Passport

@Tedderouni double check in your config/auth.php, when using Laravel Passport the driver for api guard should be set to passport.

The default is token, which is used when not using the Laravel Passport package.

See below, around line 44 of auth.php config file

'api' => [
    'driver' => 'passport',
    'provider' => 'users',
]
19 Dec
1 year ago

bearcodi left a reply on Best Approach To Multiple Domains In Same Project

I know this is old, but the environments example for people stumbling across this:

DOMAIN_WWW=domain.com
DOMAIN_MOBILE=mobile.domain.com

Then access them using Laravel's env() helper function which would also allow you to set lazy fallbacks:

Route::group(['domain' => env('DOMAIN_WWW', 'domain.com')], function(){
    //...
});

Route::group(['domain' => env('DOMAIN_MOBILE', 'mobile.domain.dev')], function(){
    //...
});

Then you can set a .env for all your different environments

13 Feb
2 years ago

bearcodi left a reply on Can't Authenticate User (passport Oauth/token)

Hi,

Looks like you have your Vue http request pointing to http://localhost:8000/oauth/token

If you check your routes list you'll see the endpoint is http://localhost:8000/api/oauth/token

So you just need to update the code in the Vue file to:

...
    this.$http.post('http://localhost:8000/api/oauth/token/', data).then((response) => {
...