Nicoeg

Nicoeg

Web-developer at CodePan I/S

Odense, Denmark

Hire Me

Member Since 4 Years Ago

Experience Points 29,750
Experience
Level
Lessons Completed 356
Lessons
Completed
Best Reply Awards 3
Best Answer
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.

19 Jan
1 year ago

Nicoeg left a reply on Trigger An Event After Saving/updating/deleting An Object (Laravel 5.3)

Hey

Take a look at the Events section of the Laravel docs. That'll do the job! Feel free to ask if you have any questions regarding this :)

https://laravel.com/docs/master/eloquent#events

Nicoeg left a reply on Custom Validation Required In Other Field In Whitelist Array

I think the validation rule in will solve your problem.

You can use it with the Rule class:

$rules = array(
    'colour' => Rule::in($whitelist),
);

Or implode the array like you are already doing:

$rules = array(
    'colour' => 'in:implode(',', $whitelist)'
);
12 Jan
1 year ago

Nicoeg left a reply on Asset Lifecycle

It does not. Assets like CSS and JS are handled directly.

You can test this by simply putting a die('Test'); in the public/index.php file and see that you'll still be able to access the assets.

23 Dec
1 year ago

Nicoeg left a reply on Sweetalert2 Confirm Box Is Not Working In Ajax And Laravel 5.3

Where are you defining the variable msg?

Nicoeg left a reply on How To Post A Login Form From Another Page To /login?

Seems like the validation is failing. Try doing a dump of the errors object anywhere on your form page.

{{ dd($errors->all()) }}

Nicoeg left a reply on Access In View Variable Passed By Controller

There are a couple of ways to do this. One is to call ->with('isRenter', $isRenter)

You can read more here (https://laravel.com/docs/master/views#passing-data-to-views)[https://laravel.com/docs/master/views#passing-data-to-views]

Nicoeg left a reply on Unable To Insert Timestamp Values While Using Laravel's Attach Method

You need to use the withTimestamps() method. Like this:

public function privileges(){
    return $this->belongsToMany('App\Privilege','provider_member_privileges','provider_member_id','privileges_id')->withTimestamps();
}
29 Nov
2 years ago

Nicoeg left a reply on Multiple Tag (Pivot Table) Searching

Have you tried whereInand whereNotIn methods?

Like this: $query->whereIn(['family', 'water'])->whereNotIn(['kids'])

12 Nov
2 years ago

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3

When you use the Route::resource call the plural version you define(articles) will be converted to the singular version article. Which means that in your RouteServiceProvider you'll have to bind it to article instead like this:

Route::bind('article', function($id) {
     return \App\Article::published()->findOrFail($id);
});             

Hope this helps :)

11 Nov
2 years ago

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3

I've tried replicating your code and it works perfectly find on my end. Would you mine putting your project on Github so I can have a further look?

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3

You're right, sorry.. Could I see your routes file where you're using this?

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3

You're missing the return statements for the scopePublished and scopeUnpublished methods :)

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3

Can you show me the published function on article and a route where you are using the articles

28 Oct
2 years ago

Nicoeg left a reply on Avoid Multiple Selections In Select Field With Blade?

It is generally not a good idea to store an array as a string in the database. But a way to solve it with your current structure could be to define an accessor on your alert model. You can read more about Accessors here.

public function getLocationAttribute($value) {
    return explode(',', $value);
}

Then you could loop through all locations and if the location exists in your $alert->locations add the selected attribute.

@foreach($locations as $location)
        <option @if(isset($alert) && in_array($location->name, $alert->locations) selected @endif>{{ $location->name }}</option>
@endforeach
08 Sep
2 years ago

Nicoeg left a reply on Thumbnail With Intervention - 5.3

I think you need to do: Image::make($request->file('image'))->fit(200)->save()

Nicoeg left a reply on Send Json Back

I believe you are using the with() method in a wrong context. with() is used to load relationships , where I believe you are trying to get certain fields from the database table?

Try removing ()->with('status', 'subject', 'user') so you are left with $tickets = $user->tickets;

Nicoeg left a reply on Can Not Get The Value Of FormData When Using Vue-resource

Try ´$request->get('publishing_days')´

14 Jun
2 years ago

Nicoeg left a reply on Sh: Composer: Command Not Found

@ejdelmonico Didn't work for me.. echo $HOME returns /Users/nicolaj

13 Jun
2 years ago

Nicoeg left a reply on Sh: Composer: Command Not Found

Just tried it without success.

Nicoeg left a reply on Sh: Composer: Command Not Found

composer is /usr/local/bin/composer

12 Jun
2 years ago

Nicoeg started a new conversation Sh: Composer: Command Not Found

I know that there are a million threads on this problem, and at this point I believe I've tried every single one.

The problem happens whenever I call the Laravel installer: laravel new app. When I call composer create-project --prefer-dist laravel/laravel app everything works fine.

I'm using zsh and my path looks like this: export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/.composer/vendor/bin:$PATH".

What could possibly be the reason for this not working?