mibu31

mibu31

Member Since 5 Years Ago

Experience Points 2,125
Experience Level 1

2,875 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 18
Lessons
Completed
Best Reply Awards 2
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.

20 Aug
3 years ago

mibu31 started a new conversation Transient/temporary Model Variables - "unknown Column" When Saving.

Hi there,

I have an eloquent model which I'm instantiating with an array of data.

Not all of the array fields are fields in the database table and so I'm receiving a "unknown column" error when trying to save it.

From reading online, if I declare the variable on the model: e.g. public $variable_name = "some default"; then it won't add it to the attributes array/try insert it into the database.

This works but only when I'm using $fillable but does not work when using $guarded. Is this a bug? : /

Thank you,

04 Aug
3 years ago

mibu31 left a reply on Eloquent Scope - Where Count

Final bump before I convert this to a join ^_^ - thank you.

03 Aug
3 years ago

mibu31 left a reply on Eloquent Scope - Where Count

Yeh, that was my fear unfortunately :(

31 Jul
3 years ago

mibu31 left a reply on Eloquent Scope - Where Count

@gregurco "order_items" is a relationship. Cheers

mibu31 left a reply on Eloquent Scope - Where Count

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'order_items' in 'where clause' :(

mibu31 started a new conversation Eloquent Scope - Where Count

Hello chaps,

I'm hoping someone can help with this scope...

/**
 * Ensures the course date is bookable.
 *
 * @param $query
 */
public function scopeVacanciesAvailable($query)
{
    /** @var Builder $query */
    $query->whereDoesntHave('order_items')->orWhere(function($q) {
        /** @var Builder $q */
        $q->whereHas('order_items', function($q) {
            $q->whereHas('order', function($q) {
                $q->successful();
            });
        })->where('vacancies', '>', I_NEED_THE_COUNT_OF_ORDER_ITEMS_HERE);
    });
}

I'm stumped at the final "where" clause, I need it to check that the number of "vacancies" is greater than the "order_items" count.

I appreciate your time and feedback, thank you.

13 Jan
4 years ago

mibu31 left a reply on MySQL Date Formats

Apologies, I think this post covers mostly what I needed to know - http://stackoverflow.com/questions/409286/datetime-vs-timestamp

Please feel free to post a reply though as I'd still be interested to hear what you have to say :) Cheers,

mibu31 started a new conversation MySQL Date Formats

Hi guys,

So I'd like some words of wisdom about MySQL date formats.

I came across a problem this morning where a date on a history timeline wasn't saving correctly and this was because the data type was set to TIMESTAMP and the date in question was before 1970 and therefore causing problems when saving.

I'm using mutators to deal with dates (mainly Carbon) and I fixed the above problem by setting the data type to DATETIME.

I'd really like to know a bit more about the different types and I'd appreciate it if someone could please give an overview as to the pros/cons of each type? Should I have used DATE rather than DATETIME? Are there differences in performance? Does MySQL have more functionality using one over the other? etc.

Thanks for your time, Mike

05 Jan
4 years ago

mibu31 left a reply on Page Slugs And Nesting

Sorry, I didn't give a very good example :( Let's just imagine a scenario where all the pages are dynamic and therefore all slugs are changeable.

mibu31 started a new conversation Page Slugs And Nesting

Hi there,

Could someone please point me in the right direction for dealing with nested pages and slugs. eg. "about-us/meet-the-team/steve-o"

Unfortunately as soon as the number of pages increase/depth of the nested pages, queries can increase quite drastically!

The two routes I have in mind are: 1. Use "parent_id" and recursively loop through parents to generate the slug and to implement caching/ 2. Use nested sets.

Could someone who's "been there done that" with a variety of methods please advise me on what worked best for them?

Thank you.

24 Dec
4 years ago

mibu31 left a reply on [L5] Ajax File Upload

Forgive me as I'm not currently using L5 but... hopefully this will help:

http://words.weareloring.com/development/laravel/laravel-4-csrf-tokens-when-using-jquerys-ajax/

Set a meta tag called "_token" using csrf_token(). You can then tell jQuery to pass this token as a custom header for AJAX requests. Modify your CSRF filter - if the request is an AJAX request, tell it to retrieve the token from the request header ($token = Request::ajax() ? Request::header('X-CSRF-Token') : Input::get('_token');)

mibu31 left a reply on Should I Create Objects?If Yes, Where Should I Keep The Class ..i Mean In Which Folder?

Yep, assuming a "students" table, create a "Student" model in /app/models . I'd recommend having a good read through the documentation, in particular http://laravel.com/docs/4.2/eloquent#basic-usage

08 Oct
4 years ago

mibu31 left a reply on Update File Uploads / Required

Resolved :) - Thanks MThomas!

mibu31 left a reply on Update File Uploads / Required

Thank you MThomas! I still can't get it working quite how I'd like it though :(

I've got "sometimes|required" - however blank file inputs show as NULL which means the required is still run as the input is in the Input:: array.

Looks like I'll need to try the closure / condition statements or I'm welcome to suggestions!

mibu31 started a new conversation Update File Uploads / Required

Hi guys,

When updating a model which has file inputs, those file inputs cannot be pre-populated (model binding / manually) with a value. Using the "required" validation rule on those inputs means the form can not be validated as they are seen as empty/invalid even though they actually have a valid value from the initial creation. I've tried adding hidden inputs below the file inputs but still no luck? I can't seem to find anything about this online so maybe I've just been really silly and overlooked something? I hope I've explained the situation well enough, it's quite difficult to put into words!

Thanks for reading and I really do appreciate any help/responses. Mike