Nicoeg

Web-developer at CodePan I/S

Hire Me

Experience

22,600

3 Best Reply Awards

  • Member Since 3 Years Ago
  • 285 Lessons Completed
  • 1 Favorite

19th January, 2017

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

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 • 5 months ago

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)'
);

12th January, 2017

Nicoeg left a reply on Asset Lifecycle • 5 months ago

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.

23rd December, 2016

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

Where are you defining the variable msg?

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

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 • 6 months ago

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 • 6 months ago

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();
}

29th November, 2016

Nicoeg left a reply on Multiple Tag (Pivot Table) Searching • 6 months ago

Have you tried whereInand whereNotIn methods?

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

12th November, 2016

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3 • 7 months ago

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 :)

11th November, 2016

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3 • 7 months ago

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 • 7 months ago

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 • 7 months ago

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

Nicoeg left a reply on RouteServiceProvider Bind Problem In Laravel 5.3 • 7 months ago

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

28th October, 2016

Nicoeg left a reply on Avoid Multiple Selections In Select Field With Blade? • 7 months ago

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

8th September, 2016

Nicoeg left a reply on Thumbnail With Intervention - 5.3 • 9 months ago

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

Nicoeg left a reply on Send Json Back • 9 months ago

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 • 9 months ago

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

14th June, 2016

Nicoeg left a reply on Sh: Composer: Command Not Found • 1 year ago

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

13th June, 2016

Nicoeg left a reply on Sh: Composer: Command Not Found • 1 year ago

Just tried it without success.

Nicoeg left a reply on Sh: Composer: Command Not Found • 1 year ago

composer is /usr/local/bin/composer

12th June, 2016

Nicoeg started a new conversation Sh: Composer: Command Not Found • 1 year ago

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?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.