dazzz1er

dazzz1er

Member Since 4 Years Ago

Experience Points 9,750
Experience Level 2

250 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 140
Lessons
Completed
Best Reply Awards 3
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

08 Oct
3 years ago

dazzz1er left a reply on Update User Account

Hey @t0ne, yeh ideally you'd want to bcrypt the password before saving it in the database, never one to shy away from a one-liner if I can help it:

$user->update($request->has('password') ? array_merge($request->except('password'), ['password' => bcrypt($request->input('password'))] : $request->except('password'));

How does that sound?

dazzz1er left a reply on [Package] Laravel 5 Real-time Chat

hi @Red scorpion sorry for the very late reply, I'm working on some other projects at the moment but a search feature would be a great addition to the package. Once I've updated the package to work with 5.1 then I will look to implement something like that :)

12 May
4 years ago

dazzz1er left a reply on Using ->with() With Constraints, Issue With 'HAVING'

My guess would be that the having clause is evaluated prior to the select, so that SQL doesn't know what distance is an alias for when it evaluates the having clause - therefore it checks for a column named distance, and fails when it doesn't find one.

09 May
4 years ago

dazzz1er left a reply on Error In Validation Request

Try replacing

use Request;

with

use Illuminate\Http\Request;

I think Laravel is resolving your Request $request in the method to the Request facade because you've referenced that instead of Illuminate\Http\Request.

dazzz1er left a reply on Call Helper Functions In Views

There shouldn't really be much cause to use Carbon in a view, ideally for me it should stick to being in a model or at worst a controller. If you are converting dates that you fetch from an Eloquent model into Carbon instances then this can be done automatically by adding them to a dates property in your model like so:

protected $dates = ['left_at', 'returned_at'];

(created_at and updated_at are automatically converted to Carbon instances) and then you can just use Carbon methods on those dates whenever you fetch them, i.e. in your view:

<span id="time-left">{{ $model->left_at->diffForHumans() }}</span>

If you really do need to use Carbon in a view you can do it like so:

<span>{{ \Carbon\Carbon::parse($your_date)->diffForHumans() }}</span>

dazzz1er left a reply on Call Helper Functions In Views

Your current method is non-static, if you are wanting to use static methods (which read like Helper::test()) then you can modify your Helper class like so:

class Helper {

    public static function test()
    {
        return 'Test';
    }

}

and then keep your autoload as it is, and call in your views:

<span class="name">{!! \Helper::test(); !!}</span>

dazzz1er left a reply on Call Helper Functions In Views

@dixitchopra it looks like your file is being autoloaded okay, but you are calling a non-static method statically in your code.

With your current code you can put

<span class="name">{{ (new \Helpers)->test(); }}</span>

and it should work, but you would be better to make your test method static like:

public static function test()
{
    return 'Test';
}

dazzz1er left a reply on Error In Validation Request

According to Laravel docs http://laravel.com/docs/5.0/validation#controller-validation

The method is validate not validator like in your original code!

dazzz1er left a reply on [Package] Laravel 5 Real-time Chat

For those interested there is now a demo at www.confer.work (excuse the .work, it was cheap but now I like it!) which applies my demo scenario above. Try not to write any sensitive information (or rude things!) as user accounts are generic and messages persist across different users on the same account.

Ideally visit the site at the same time as a colleague/friend and private message each other... or you could just message another online user if available.

dazzz1er left a reply on Update User Account

I think you could also do this:

if ($request->has('password') $user->password = bcrypt($request->input('password');

As the has method checks for an empty string. Basically the same thing but thought I would mention!

Or you could replace

$user->update($request->all());

with

$user->update($request->has('password') ? $request->all() : $request->except(['password']));

in your original code, which resolves it in one line and allows for future User properties being added.

25 Apr
4 years ago

dazzz1er left a reply on [Package] Laravel 5 Real-time Chat

@ufodisko I would like to host a demo for you, but the project uses Pusher for its real-time element which I currently only have a sandbox plan for (limits me to 20 concurrent users). I could perhaps set up a demo whereby each user coming to the demo site can log in as an available user (logging out frees up a user) so that it never exceeds 20, but it would take some time to implement.

If you are interested then perhaps the best way to demo for the moment is to download and try it out. Apologies that I can't be more helpful.

dazzz1er left a reply on There Is Any Full Tutorial About Laravel 5 Package ?

@wowrudy I just made one for the first time and did it via making a new folder on my local file system, adding a composer.json and then adding these lines to my laravel project I used to test:

"repositories": [
      {
         "type": "vcs",
         "url": "/path/to/new/package/folder"
      }
   ],
"require": {
        "packagename": "*"
}

and then you can just require your new package like any other (as above) and it will be pulled in from your local folder instead of packagist.

So for example all my projects are in a /Code directory, the new package is at /Code/package and my test Laravel 5 project pulling it in via composer is at /Code/testproject.

Annoyingly you must then composer update everytime you make a change, but you can create a symlink to skirt having to do that!

dazzz1er started a new conversation [Package] Laravel 5 Real-time Chat

Hey guys I'm new here, but a big fan of the community and the videos!

I've recently been working on a few websites which require a real-time chat service between its users, so thought I'd put together a Laravel 5 package which adds real-time chat and messaging features to a website/application in a few lines of code.

It's pretty much an alpha at the moment, but if you're interested or are looking for something to use in your project, you can check it out at https://github.com/dazzz1er/confer and https://packagist.org/packages/djb/confer !

Dan