ovvessem

ovvessem

Member Since 5 Years Ago

Oosterhout

Analyst Consultant at Netherlands

Experience Points 150,285
Experience Level 31

4,715 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 1424
Lessons
Completed
Best Reply Awards 6
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.

11 Oct
7 months ago

ovvessem 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.

15 Nov
1 year ago

ovvessem left a reply on 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.

ovvessem left a reply on Problem Regarding Voyager Admin Panel

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

ovvessem left a reply on 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 make use of the package clockwork - https://github.com/itsgoingd/clockwork or debugbar - https://github.com/barryvdh/laravel-debugbar.

ovvessem left a reply on 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);
24 Sep
1 year ago

ovvessem left a reply on 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/

06 Sep
1 year ago

ovvessem left a reply on Excel Vlookup With Laravel Collections

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

ovvessem left a reply on 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.

ovvessem left a reply on 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

ovvessem left a reply on 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 and changes to .js().

31 Aug
1 year ago

ovvessem left a reply on How Do I Switch To Bootstrap 4 In Laravel 5.5?

To use Bootstrap 4, 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 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 folder. Also make sure to remove the reference to variables since these will not work with Bootstrap4
  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.

13 Jan
2 years ago

ovvessem left a reply on 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.

11 Jan
2 years ago

ovvessem left a reply on 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.

23 Nov
2 years ago

ovvessem left a reply on 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:

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

ovvessem left a reply on 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() {
    $this-> belongsToMany(Roles::class); 
}

You can then use this in your blade template:

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

ovvessem left a reply on 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).

19 Jan
3 years ago
14 Oct
3 years ago

ovvessem left a reply on 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.

08 Oct
3 years ago

ovvessem left a reply on 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!

07 Oct
3 years ago

ovvessem left a reply on Link To Javascript File With Slash '/'

Hi Snapey,

Than for your reply. I have switched to /js/holder.js/900x300 but that doesn't resolve the issue that is an invalid route.

For now I switched to placehold.it to keep the work going.

ovvessem 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.

08 Sep
3 years ago

ovvessem left a reply on 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.

04 Sep
3 years ago

ovvessem left a reply on 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.

ovvessem 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.

03 Sep
3 years ago

ovvessem left a reply on 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/.

31 Aug
3 years ago

ovvessem left a reply on Potential Virtual Box 5.0 & Homestead Incompatibility

Hi @mikebronner, thanks for sharing your process!

ovvessem left a reply on Homestead Server Not Found

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

ovvessem left a reply on 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.

19 Aug
3 years ago

ovvessem left a reply on � Showing At Special Characters

Make sure you have html<meta charset="utf-8"> in your HEAD definition of your HTML page

02 Jul
3 years ago

ovvessem 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!

29 Jun
3 years ago

ovvessem left a reply on Javascript Src Is The Wrong Path

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

ovvessem left a reply on Javascript Src Is The Wrong Path

If you are using Homestead or the command

php artisan serve

the document_root is /public/. In that case the link to your javascript source will be correct.

23 Jun
3 years ago

ovvessem left a reply on 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');
22 May
3 years ago

ovvessem left a reply on 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?

09 May
4 years ago

ovvessem left a reply on 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')

Create the footer partial as the default

In the view where you want to overwrite the default footer you can use the following code:

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

ovvessem started a new conversation Database Schema Best Practice

Hi,

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

Questionnaire
-- Competence
---- Question
-- Group
---- Respondents

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 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!

19 Mar
4 years ago

ovvessem left a reply on Laravel Elixir: What Else

Thanks @anheru88 for providing the package! Works great!

17 Mar
4 years ago

ovvessem left a reply on Restarting Nginx Nginx [fail]

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

ovvessem left a reply on 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();
16 Mar
4 years ago

ovvessem left a reply on How To Change The Field For Username In Login

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

ovvessem left a reply on 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.

12 Mar
4 years ago

ovvessem left a reply on 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.

11 Mar
4 years ago

ovvessem left a reply on 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.

ovvessem left a reply on 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.

04 Mar
4 years ago

ovvessem left a reply on What Chrome Extensions Does Jeffrey Use?

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

03 Mar
4 years ago

ovvessem left a reply on 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.

24 Feb
4 years ago

ovvessem left a reply on Jeff's Theme [Updated]

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

13 Feb
4 years ago

ovvessem left a reply on Homestead DB Connection Problem

I am also looking for this answer to use my local terminal app to make use of the php artisan migrate command with the understanding that I use homestead.

I have tried all of the above but still facing the error message that says I can not connect (via localhost and or 192.168.10.10)

My situation is as follows:

I have a local install of MAMP which provides my PHP. I have MAMP running with Apache and MySQL and my .env settings are:

APP_ENV=local
APP_DEBUG=true
APP_KEY=<somekey>

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file

The reason why I would like to perform the action from my local machine is because I would like to use one terminal instance for all the artisan commands and gulp watch which does not support the information message in the VM.

I hope someone in the community stumbled on the same situation and can clear out.