ovvessem

ovvessem

Analyst Consultant at Netherlands

Member Since 5 Years Ago

Oosterhout

Experience Points
157,055
Total
Experience

2,945 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
1490
Lessons
Completed
Best Reply Awards
6
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.

Level 32
157,055 XP
Aug
22
1 month ago
Activity icon

Commented on Reduce A Query From 12 Seconds To 1 Millisecond

Thanks for especially this episode in the series. I was never aware of the fact that YEAR() is much slower then BETWEEN date AND date

Jun
04
4 months ago
Activity icon

Replied to How To Stop Auto-playing Of Videos?

In Google Chrome type the following in your address bar: chrome://flags/#autoplay-policy

When the flags window appears, autoplay will standout in yellow, and it will also be the first option on the list. Click on the drop-down menu to the right and choose the option that says Document user activation is required.

Oct
11
1 year ago
Activity icon

Started a new conversation Event + Listener Or Model Observer

Hi community,

I am currently building a new application which should interact with a third application through an API. For example if a new customer is created it should also create/provision it in the third party application and send a notification to the new customer.

I have read about Event + Listener and Model Observers in the Laravel documentation and am curious what is best practise to execute the provisioning. From what I understand an Observer is used to group all of the listeners into a single class.

Should I use a model observer and put the necessary actions (provision customer en and notification) in the e.g. created handle event or should I define a protected dispatchesEvents on the Model and generate the Event en Listener where per action there is one listener?

Love to hear best practised from the community. Thanks in advance.

Nov
15
1 year ago
Activity icon

Replied to Laravel 5.5 Doesn't Authenticate Properly Based On Database Columns

Can you add a screenshot of your table definition in the database. Definition of the migration should also be fine to investigate further.

Activity icon

Replied to Problem Regarding Voyager Admin Panel

Just to be sure, have you checked the database for any existing tables?

Activity icon

Replied to Get All With Count Of Specific Condition.

@RonaldGJ Yes, with the raw query you would get the total counts for both conditions. If you want the list in combination with the total count then the raw statement is not what you are looking for.

More suitable approach would be the suggestion @Drfraker gave. To confirm it will not run a new query against the database. If you are curious which query's are executed you could use of one of the following packages:

Activity icon

Replied to Get All With Count Of Specific Condition.

One option would be to have 2 query's. Another option would be to make use of DB::raw() - https://laravel.com/docs/5.5/queries

$select = DB::raw(
'COUNT(*) AS total
, COUNT(CASE status WHEN "paid" THEN 1 ELSE NULL END) AS paid
');

$metrics = DB::table('subscriptions')->select($select);
Sep
24
2 years ago
Activity icon

Replied to Laravel Charts Export As Image

Can you tell which underlying chart library you are going to use. Have a look at https://erik.cat/projects/Charts/docs/5#create-charts the underlying libraries.

Because charts makes use of these libraries you can view their documentation to find an implementation to render the chart as an image. For example Highcharts has an great API which supports export to image. See this fiddle as an example: http://jsfiddle.net/willkoehler/1p81fbzs/

Sep
06
2 years ago
Activity icon

Replied to Excel Vlookup With Laravel Collections

Can you give more details please about what you want to achieve?

Activity icon

Replied to Improve WhereTime Between Methods

You can use the following syntax:

MyEloquentModel::whereDate('created_at','>=','2017-09-06')
               ->whereDate('created_at','<=','2017-09-06')
               ->whereTime('created_at','>=','00:00:01')
               ->whereTime('created_at','<=','23:59:59')
               ->get();

Of course for the hard-coded values you could levarage Carbon.

Activity icon

Replied to Uploading An Image Using Vue?

Hi @Alizharb if you are subscribed to Laracasts please have a look at this tutorial which explains how to upload an image with Vue.

https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/65

Activity icon

Replied to Integrating Bootstrap 4 Beta

Agreeing with @rawfan. Yes it works but with this 'solution' you will load the same libraries (jquery, popper and bootstrap) multiple times which leads to unnessecary overhead.

No need for the autoload definition and changes to .js() in webpack.min.js.

Aug
31
2 years ago
Activity icon

Replied to How Do I Switch To Bootstrap 4 In Laravel 5.5?

To use Bootstrap 4 (BS4), which is in beta at the moment of writing, you will need to take the following steps:

  1. run npm install [email protected] --save-dev to install/overwrite to the latest version
  2. change require('bootstrap-sass') to require('bootstrap') in your bootstrap.js file
  3. change @import "~bootstrap-sass/assets/stylesheets/bootstrap"; to @import "~bootstrap/scss/bootstrap"; in your app.scss file. Also make sure to remove the reference to variables since these will not work with BS4
  4. run npm run dev in the command line to generate the .css and .js file

Please be aware that the scaffolded auth templates will break due to new class names in BS4.

Jan
13
2 years ago
Activity icon

Replied to Install Laravel In Shared Host's Public Folder?

I agree with @Snapey. If your current provider does not support SSH or even change the public document root it could be a wise decision to look elsewhere.

Jan
11
2 years ago
Activity icon

Replied to Install Laravel In Shared Host's Public Folder?

Hi @Peter-Westerlund,

If your control panel allows changing the document root entry point you can place all the laravel and framwork related files in your /web folder.

Within the control panel you change the default document root from /web to /web/public to serve your laravel based application.

Nov
23
2 years ago
Activity icon

Replied to Inserting Additional Data Into User's Database

Hi @yansusanto,

Currently you are creating a new user where you want to update the existing user record. What you want is something like this:

<?php

$user = auth()->user();
$user->field_to_update = $request->field_to_update;
$user->save();
Jun
30
3 years ago
Activity icon

Replied to Show User Roles From Other Table

Hi @ThomHofstede ,

Like @thefuzzy0ne mentioned the best thing is to create a relationship between User and Role model to (eager) load the associated roles. I am assuming a user can have more then one role.

public function roles() {
    return $this->belongsToMany(Role::class); 
}

You can then use this in your blade template:

@foreach(auth()->user()->roles as $role)
<li>{{ $role->name }}</li>
@endforeach 
Apr
15
3 years ago
Feb
26
3 years ago
Activity icon

Replied to What Theme Jeffrey Way Use?

It is called the Material Theme like @DPJack already mentioned :)

Here is the link to the GitHub repo to view the source and download it (also possible through Package Control in Sublime Text (2/3).

Jan
19
3 years ago
Oct
14
4 years ago
Activity icon

Replied to My Laravel 5.1.16 Didn't Come With Twitter Bootstrap

Do not forget to uncomment the bootstrap require in the default app.scss you can find in /resources/assets/css/app.scss.

Oct
08
4 years ago
Activity icon

Replied to Link To Javascript File With Slash '/'

@Snapey I misunderstood your explanation. Have applied it and works as designed. Thanks for taking the time to answer my question!

Oct
07
4 years ago
Activity icon

Started a new conversation Link To Javascript File With Slash '/'

Hi,

For my current project I would like to make use of holder - https://github.com/imsky/holder

The code I would like to use is:

<img src="/js/holderjs.js/900x200" alt="First slide">

Because of the '/' after holder.js I get a NotFoundHttpException in RouteCollection.php

Is there any way to go around this. I am using Homestead nginx.

Sep
08
4 years ago
Activity icon

Replied to Multi-Tenant Tutorials

The link on laravel-news refers to this blog post: http://culttt.com/2014/03/31/multi-tenancy-laravel-4/

It was very useful for me.

Sep
04
4 years ago
Activity icon

Replied to Deploy To Shared Hosting

Hi @wadey,

You could move the entire application into the www folder (the DocumentRoot).

Now inside your www folder, place the following .htaccess file.

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

This should redirect all the requests to the Laravel public folder. Requests to your public folder to, for example, asset files will still be accepted.

Activity icon

Started a new conversation Polymorphic Relation For Users

Hi community,

I am seeking for a good solution to set up my Eloquent Models and database structure to provide in the following scenario:

I am building a questionnaire application where I have the following Model hierarchy:

Tenants -- Organizations -- Questionnaires

Both the Tenants and Organizations have admins (users) to manage them. I would like to store these user accounts in the same table 'Users'. To determine their belonging I was thinking to use polymorphic relations so I can use the default authentication mechanism from the users table.

On the users table I have defined the following polymorphic columns: userable_id and userable_type.

Further I have created the Models TenantUser and OrganizationUser with the following relation

public function user()
 {
      return $this->morphOne('User', 'userable');
 }

So far so good I think. But my question is how can I fetch all the TenantUsers that belong to a certain Tenant?

Do I need to use the TenantUsers model and define a tenant_id in the tenant_users table or can it be achieved from the User Model?

public function users()
{
    return $this->morphMany('App\User', 'userable');
}

Does not give my any results which I understand because userable_type has the value of App\TenantUser or App\OrganizationUser.

Any guidance would be much appreciated. Thanks!

Sep
03
4 years ago
Activity icon

Replied to Deploy To Shared Hosting

Hi @wadey,

If you have no other option at your disposal to put everything in the public folder then you can limit the access with an .htaccess file and change the paths to the laravel public folder.

Another solution, if the CP of your hosting provider supports it, to change the default document root to the public folder of laravel. So that would be like /public/laravel/public/.

Aug
31
4 years ago
Activity icon

Replied to Potential Virtual Box 5.0 & Homestead Incompatibility

Hi @mikebronner, thanks for sharing your process!

Activity icon

Replied to Homestead Server Not Found

Just to be sure; are you updating your hosts file accordingly to the newly added project?

Activity icon

Replied to Laravel 5.1.11 Brings Us Authorization! (User Permissions / Access Control)

Hi @FabianH,

I had the same issue after following the upgrade instructions from laravel 5.1.x to 5.1.11. I have created a fresh Laravel install with laravel new [projectname] and merged the /vendor directory with my existing directory. I know it is a workaround but it did the job.

Aug
19
4 years ago
Activity icon

Replied to � Showing At Special Characters

Make sure you have the following declaration in your HEAD definition of your HTML page.

<meta charset="utf-8">
Jul
02
4 years ago
Activity icon

Started a new conversation Upgrade Laravel/laravel From 5.1 To 5.1.5 (latest Release)

Hi everyone,

I hope to find one or more answers from the active community. How would you upgrade your laravel application from one version to another higer one. In this particular case from 5.1 to 5.1.5. I am not talking about the laravel/framework because that would be done by a composer update.

Do you guys pull in the latest version from composer and/of laravel new and then place your own files within it or is there a better, more constructive, approach to that?

Love to hear from the community. Thanks in advance!

Jun
29
4 years ago
Activity icon

Replied to Javascript Src Is The Wrong Path

@Corbin you can leave of the URL:: part :)

Activity icon

Replied to Javascript Src Is The Wrong Path

If you are using Homestead or the command

php artisan serve

which will create an access point from http://localhost:8000 the document_root is /public/. In that case the link to your javascript source will be correct like in http://localhost:8000/js/app.js. Also make sure you make use of the asset helper

<script type="text/javascript" src="{ { asset('js/app.js') } }"></script>

If you want to make use of plain HTML syntax make sure you put a '/' before app.js to be absolute.

Activity icon

Replied to Snippet For Profile Pictures / Avatar Upload

Thanks for sharing!

Jun
23
4 years ago
Activity icon

Replied to Date Localization

Please be aware that some servers need the following setlocale syntax:

setlocale(LC_TIME, 'nl_NL.UTF-8');

or for all locales at once

setlocale(LC_ALL, 'nl_NL.UTF-8');
May
22
4 years ago
Activity icon

Replied to Share Your PHPStorm Live Templates

@HoLyCoW I am using PHPStorm 141-1224 which is the latest EAP build at the moment of writing but did not find the Bootstrap or jQuery CDN live templates you mentioned.

Can you tell me where you found them in the Live Templates section within the Preferences pane of PS?

May
09
4 years ago
Activity icon

Replied to Default Blade Template For @yield

You can do this as follows:

Suppose you have a master template called app.blade.php. In this template you define the next two lines

@include('_partials.footer')
@yield('footer')

You are not required to use an include. If you want you could state the @section definition directly in app.blade.php. I use it to separate segments from my page.

The footer partial looks as follows:

@section('footer')
    Default footer content
@stop

To overwrite a section entirely, you may use the overwrite statement like defined below. This code should be placed in the blade template from where you want to overwrite the footer partial.

@section('footer')
    Footer overwrite content
@overwrite
Apr
22
4 years ago
Activity icon

Started a new conversation Database Schema / Relations Best Practice

Hi,

I am working on a questionnaire application which holds the following tables and associated model:

Questionnaire
-- Competence
---- Question
-- Group
---- Respondent

At the moment I have set up the following relations

Questionnaire hasMany Competence
Competence hasMany Question
Questionnaire hasMany Group
Group hasMany Respondent

The models on the right hand side have an (model)_id column from the model on the left hand side. From right to left they all have belongsTo relation.

To fetch all the respondents on the questionnaire I could use eager combined loading as follows:

$questionnaire = Questionnaire::with('group.respondent')-:firstOrFail();

I am looking for a best practice in regards to relations. Is the above scenario best practice or should I relate Respondent directly to the Questionnaire with a hasMany and therefore add the column questionnaire_id in the repondents table?

Hope to get some answers from the community who struggled with this scenario earlier.

Thanks in advance!

Mar
19
4 years ago
Activity icon

Replied to Laravel Elixir: What Else

Thanks @anheru88 for providing the package! Works great!

Mar
17
4 years ago
Activity icon

Replied to Restarting Nginx Nginx [fail]

I was facing the same issue. Thanks for bringing it up @mstnorris.

Activity icon

Replied to Pulling Info From Mysql

Please have a look at the excellent Laravel documentation and to be specific the Eloquent section: http://laravel.com/docs/5.0/eloquent

To be short; create a model like say Customers and in your controller you can fetch all the data from that model with the following line of code

$customers = Customer::all();

In the return you can give the customer information to the view with the following line of code:

return view('customer.index', compact('customers'));
Mar
16
4 years ago
Activity icon

Replied to How To Change The Field For Username In Login

@scotthummel What do you mean by 'how do I change my password field'?

Activity icon

Replied to How To Change The Field For Username In Login

You'll need also to update app/Services/Registrar.php for registration. It requires email and puts it in the database.

Mar
12
4 years ago
Activity icon

Replied to Blade Template Form Display Fields Depending On Dropdown Selection

Have a look at http://www.appelsiini.net/projects/chained for chained dropdown boxes with the use of jQuery.

Mar
11
4 years ago
Activity icon

Replied to Database Configs Stored In Base Database

Have a look at http://laravel.com/docs/5.0/routing#route-groups to answer your question about how to fetch the {name} within the URL.

Activity icon

Replied to Need To Integrate WYSIWYG Edito

Just my two cents; TinyMCE - http://www.tinymce.com/

It is free to use and you have the option to select only the things you will need for your project via http://www.tinymce.com/download/custom_package.php.

Mar
04
4 years ago
Activity icon

Replied to What Chrome Extensions Does Jeffrey Use?

Perfect extension, can't live without it anymore :)

Mar
03
4 years ago
Activity icon

Replied to Share Your PHPStorm Live Templates

Thanks for sharing @BenSmith. Question related to Live Templates in combination with Emmet. Which keystroke do you use to expand the Emmet abbreviation since TAB is needed for some Live Templates with variables.

Feb
24
4 years ago
Activity icon

Replied to Jeff's Theme [Updated]

Thanks for sharing @JeffreyWay and thanks for modifying the HTML scheme @lstables :)