mvd

Member Since 4 Years Ago

Leusden

Experience Points
73,580
Total
Experience

1,420 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
353
Lessons
Completed
Best Reply Awards
60
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 15
73,580 XP
Jan
17
2 days ago
Activity icon

Replied to I Need Help In Laravel Packages

Hi @mindorodev

Don't have experience with this package but what if you visit, https://yourwebsite.com/admin/polls ?

See the route file for this package, https://github.com/akiyamaSM/larapoll/blob/master/src/Http/routes.php

Jan
15
4 days ago
Activity icon

Awarded Best Reply on What's Wrong With My Sql Query?

@uksarkar

You are almost there, there is a little typo in your code. Change NOT EXIST to NOT EXISTS (you forgot the 'S').

Activity icon

Replied to What's Wrong With My Sql Query?

@uksarkar

You are almost there, there is a little typo in your code. Change NOT EXIST to NOT EXISTS (you forgot the 'S').

Jan
14
5 days ago
Activity icon

Replied to What's Wrong With My Sql Query?

@uksarkar and if you first do the JOIN before the WHERE statement?

SELECT  *  FROM `reservation_nights`
JOIN `reservations` ON `reservation_nights`.`reservation_id` = `reservations`.`id`
WHERE  `rooms`.`id` = `reservation_nights`.`room_id` AND `reservations`.`status` NOT IN ('CANCEL')
Dec
11
1 month ago
Activity icon

Replied to Need Laravel Advise To Render Information To The Landing Page.

@masumluf So i must query a lot of times will it effect page loading performance ?

Thats why I suggest the cach function (save/store the results from the queries for example) if you notice a high page load.

Activity icon

Replied to Datepicker Using JQuery And Bootstrap

Hi @islandman

It sounds like the bootstrap-datetimepicker css file is missing / not loaded. Can you check if this file is loaded, and if not inlcude this to your website?

Activity icon

Replied to Need Laravel Advise To Render Information To The Landing Page.

@masumluf

using a function and query for each category and store it multiple value and send it to blade page ?

That is an option, to load the information in separated variables and pass it to the view Example

$news = News::where('status', 1)->get();
$jobs = Jobs::where('status', 1)->get();
return view('landingpage', compact('news', 'jobs');

In your landingpage view you can create/include view partials, example

@include('view.jobs', ['jobs' => $jobs])

If the page is loading slow, create some kind of cach functionlity to store (a part of) the content (and rebuild this after someting is changed).

Dec
10
1 month ago
Activity icon

Replied to Object Of Class Illuminate\Database\Eloquent\Collection Could Not Be Converted To Int

@kanchan186, use the dd() function,

$mechanic=Mechanic::where(['mechanics.mechanic_id', '=', $mechanic_id])->where('active_status',1)

         ->join('countries','mechanics.mech_country','=','countries.country_id')
         ->join('states','mechanics.mech_state','=','states.state_id')
         ->join('cities','mechanics.mech_city','=','cities.city_id')
         ->get();
dd($mechanic);
Activity icon

Replied to Object Of Class Illuminate\Database\Eloquent\Collection Could Not Be Converted To Int

@kanchan186 did you also remove

if($active_status==1){

and the closing } for this statement?

Dec
09
1 month ago
Activity icon

Awarded Best Reply on How To Work With Database For Subscription

Hi @jonjie,

Increase the timestamp for subscription_ends_at ? Example:

// Load subscription and add 5 days to the current timestamp.
$subscription->subscription_ends_at ->addDays('5'));
// Update subscription
Activity icon

Replied to How To Work With Database For Subscription

@jonjie If you get the subscription with Eloquent, timestamps are in the Carbon format. Carbon is class with some nice functionalities to deal with dates in PHP. Carbon docs, https://carbon.nesbot.com/docs/

Activity icon

Replied to Object Of Class Illuminate\Database\Eloquent\Collection Could Not Be Converted To Int

Hi @kanchan186,

$active_status=MechBrand::get();
      
      if($active_status==1){

$active_status is the collection, not a integer.

You can test this to write dd($active_status);

Remove the above code (and the closing if statement) and change

$mechanic=Mechanic::where('mechanics.mechanic_id',$mechanic_id)

To

$mechanic=Mechanic::where(['mechanics.mechanic_id', '=', $mechanic_id], ['active_status', '=', 1])
Activity icon

Replied to How To Work With Database For Subscription

Hi @jonjie,

Increase the timestamp for subscription_ends_at ? Example:

// Load subscription and add 5 days to the current timestamp.
$subscription->subscription_ends_at ->addDays('5'));
// Update subscription
Dec
06
1 month ago
Activity icon

Replied to Checkbox Validation Error Message Displaying Wrongly

@rider can you upload the image to a (free) tool like https://imgur.com/ ?

Activity icon

Replied to Checkbox Validation Error Message Displaying Wrongly

hi @rider

Do you have a screenshot from this situation?

Is it a browser validation message, default Laravel error message or do you use a tool to show the errors?

Activity icon

Replied to 419 Page Expired

hi @pipariyah1

You get a 419 status code, if an (external) script tries to post to your Laravel application, without the o-so-needed CSRF token.

First option is to change in App\Http\Middleware\VerifyCsrfToken: protected $except = [ /, ]; (or maybe something more specific and a little more safe, like /myapiurl/,)

Second option is to put the route in api.php instead of web.php, but that implies prefixing all your routes with /api/

https://markohoven.com/2018/01/23/419-http-status-code/

Already see/ tried this?

Dec
05
1 month ago
Activity icon

Replied to Tooltip Display And Copy

@deepu07 but you said

below is code working for copy and but not showing the tooltip when mouse hover on a button

Copy function does work, see https://jsfiddle.net/mvd81/84motv67/28/

Dec
04
1 month ago
Activity icon

Replied to Having Problem With Cached Collection!

Hi @dgvai

->latest() instead of ->first() ?

Activity icon

Replied to Use Find() And With() Together In Laravel Query

Hi @afoysal

Edit: @sinnbeck was faster :D

Try this

Employee::with('employees.employee_locations')->find(1);
Activity icon

Replied to Tooltip Display And Copy

Hi @deepu07

$('button').tooltip({
            trigger: 'click',
            placement: 'bottom'
        });

You trigger the tooltip with a click event. You can remove the trigger or set it to 'hover'

$('button').tooltip({
            placement: 'bottom'
        });
Activity icon

Replied to Cookies Across Sub Domains

Hi @abhijeet9920

In the clear method you set->withCookie($cookies); but the variable $cookies does not exist, you need to use->withCookie($all);

If this still not working, can you try Cookie::queue('Bar_Application', null, -1, '.example.com');

Nov
26
1 month ago
Activity icon

Replied to JQuery Validator

Hi @paduraruionutandrei

I think because event.preventDefault();

What if you move event.preventDefault(); below

if($('#category-form').validate().checkForm()) {
                    $.ajax({
                        type: 'post',
                        url: '{{ route('categories.store') }}',
                        data: $('#category-form').serialize(),
                        success: function (data) {
                            console.log(data)
                        },
                    });
                }
Nov
25
1 month ago
Activity icon

Awarded Best Reply on Delete Row & All It's Relations From Db

Hi @tobyreed

You must first delete the relation and then you can call $obj->delete()

Another option is to use Foreign Key Constraints, onDelete('cascade') https://laravel.com/docs/5.8/migrations#foreign-key-constraints

Nov
21
1 month ago
Activity icon

Replied to Laravel/Lumen Logging

Hi @jayadevan

With APP_DEBUGyou show the errors on your browser screen.

If you do not want debug logs you must set the 'log level'

When using Monolog, log messages may have different levels of severity. By default, Laravel writes all log levels to storage. However, in your production environment, you may wish to configure the minimum severity that should be logged by adding the log_level option to your app.php configuration file.

Once this option has been configured, Laravel will log all levels greater than or equal to the specified severity. For example, a default log_level of error will log error, critical, alert, and emergency messages

Monolog recognizes the following severity levels - from least severe to most severe: debug, info, notice, warning, error, critical, alert, emergency.

https://laravel.com/docs/5.3/errors#log-severity-levels

Nov
20
1 month ago
Activity icon

Replied to Delete Row & All It's Relations From Db

Hi @tobyreed

You must first delete the relation and then you can call $obj->delete()

Another option is to use Foreign Key Constraints, onDelete('cascade') https://laravel.com/docs/5.8/migrations#foreign-key-constraints

Nov
19
2 months ago
Activity icon

Awarded Best Reply on Did Laravel Carbon And Eloquent Has Or Do Like Subtime() In Mysql

Hi @chalahed

In Eloquent you can use the raw functionlity

$total = "49:00:00";
  $foo = "09:00:00";
  $users = DB::table('users')
    ->select(DB::raw('SUBTIME("' . $total . '", "' . $foo . '")'))
    ->get();

In Carbon, check the 'Addition and Subtraction' section https://carbon.nesbot.com/docs/#api-addsub

Oct
04
3 months ago
Activity icon

Replied to Sidebar Menu Item Order

@sarahs74 oops sorry you're right :)

Oct
03
3 months ago
Activity icon

Replied to Sidebar Menu Item Order

Hi @sarahs74

If you get $type with a query you can use orderByRaw

Example

orderByRaw('FIELD(form, "IND", "COM", "HR", "OM", "FSR")')->get();

Also I see a lot of duplicated code, I would recommend to do something like

$allForms = array('IND', 'COM', 'HR', 'OM');

@foreach ($type->forms as $form)
    @if (in_array($form->form, $allForms) 
        
     <li class="nav-item">
                    <a class="nav-link" href="/clients/{{ $client->id }}/types/{{ $type->id}}/{{ \App\Enums\FormType::getLink($form->form) }}">
                        @if($form->completed)
                        <i class="fas fa-star"></i> 
                        @else
                        <i class="far fa-star"></i>
                        @endif
                        {{ \App\Enums\FormType::getDescription($form->form) }}
                    </a>
                </li>

    @else
        <li class="nav-item">
                    <a class="nav-link" href="/clients/{{ $client->id }}/types/{{ $type->id}}/{{ \App\Enums\FormType::getLink($form->form) }}/">
                        <i class="far fa-star"></i>
                        {{ \App\Enums\FormType::getDescription($form->form) }}
                    </a>
                </li>
    @endif
@endforeach

And this if output is the same as the else output

 @if($form->completed)
                        <i class="fas fa-star"></i> 
                        @else
                        <i class="far fa-star"></i>
                        @endif

Needs to be

@if($form->completed)
                        <i class="fas fa-star"></i> 
                        @else
                        <i class="far fa-star-o"></i>
                        @endif

?

Sep
26
3 months ago
Activity icon

Replied to Data Values Are Not Showing In Show & Edit Blade

@binadam

Route::get('product/show', '[email protected]')->name('product.show');  
Route::get('product/edit', '[email protected]')->name('product.edit');  

You don't pass the product (Id) to show or edit, change your routing like

Route::get('product/show/{product}', '[email protected]')->name('product.show');  
Route::get('product/edit/{product}', '[email protected]')->name('product.edit');  

And an example link

<a href="/product/show/{$product->id}" title="{$product->title">{$product->title}</a>
Sep
23
3 months ago
Activity icon

Replied to Database Design For LinkedIn Like User Profiles

@thebigk If you have many different fields for example school <> work then I would create a seprate table for school and work.

Only if the fields are about the same would I choose one table.

Sep
21
3 months ago
Activity icon

Replied to Database Design For LinkedIn Like User Profiles

@thebigk

Something like

id | user_id | type | from | till | info 
1 | 1 | school | 01-01-2012 | 01-01-2016 | lorem impsum
2 | 1 | work | 01-01-2016 | 01-06-2017 | work experierence text..
3 | 1 | work | 01-06-2017 | null | still working here...
Sep
18
4 months ago
Activity icon

Replied to Is It Ok That I Have Two Delete Route For One Controller ?

Hi @untymage

Yes, I can't see a problem. If you want it in one method/function you can also make the {notification} optional, {notification?}

https://laravel.com/docs/5.8/routing#parameters-optional-parameters

If the param exist only delete that notification else delete all notifications.

Activity icon

Replied to Using Laravel 5.8 Authentication With External JSON API (Creating Own ServiceProvider)

@javid020 I am not sure but you login with ajax. Do you use the @guest function after refresh the page?

Activity icon

Replied to Loop Constraining By Using Parent ID

@kamfu do you mean multi relations for a model? Example in your category model

public function products() {
      return $this->hasMany(Products::class, 'parent_id', 'id');
  }

Query:

$results = Category::select('id','name')->latest()->with(['posts', 'products'])->get();
Sep
17
4 months ago
Activity icon

Replied to FaceBook Modal Is Not Coming Up In Laravel Home Page

Hi @afoysal

Your code is not for the Bootstrap modal but for Magnific Popup (https://dimsemenov.com/plugins/magnific-popup/)

If you want to use the Bootstrap model, check this page https://www.w3schools.com/bootstrap4/bootstrap_modal.asp

Sep
16
4 months ago
Activity icon

Commented on Go Go Gadget Tailwind

Try to rebuild the node_modules

  • Delete the node_modules folder
  • Delete the package-lock.json file

Run

npm install
npm watch
Activity icon

Replied to Using Laravel 5.8 Authentication With External JSON API (Creating Own ServiceProvider)

@javid020

What do you mean with not logged in? Is this another request after the login request?

Activity icon

Replied to Using Laravel 5.8 Authentication With External JSON API (Creating Own ServiceProvider)

Hi @javid020

Did you call Auth::login($user);? Can you show us the login functionality?

Sep
13
4 months ago
Activity icon

Replied to Loop Constraining By Using Parent ID

Hi @kamfu

Why don't you add a relationship in your model for this. In your Category model

  public function posts() {
      return $this->hasMany(Post::class, 'parent_id', 'id');
  }

Your query

$results = Category::select('id','name')->latest()->with('posts')->get();
Sep
12
4 months ago
Activity icon

Replied to Set A E-mail Client For WAMP

@mego also cleared the cache? php artisan config:cache

If you run phpinfo(); What are the values for 'SMTP' and 'smtp_port' ?

Sep
11
4 months ago
Activity icon

Replied to Drag-n-drop Sorting With Child Elements

Hi @twg_

I don't know your database table structure but I suggest to create a parent column. Fill the parent ID in the parent column for the child element if it's dragged as a child.

Sep
06
4 months ago
Activity icon

Replied to Set A E-mail Client For WAMP

Hi @mego

What are your mail settings in .env?

If you use port 25 in test-mail-server-tool, try this settings in your .env config

MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=25
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=NULL
Activity icon

Replied to "The Table Is Empty :-("

@b1narylife are you sure $this->withoutExceptionHandling(); is in your test and not disabled?

Can you give us the store method (where you save a new project) code from your projects controller?

Activity icon

Replied to "The Table Is Empty :-("

@b1narylife

Are you sure the columns title and description exists or are there more required fields?

If a remove $this->withoutExceptionHandling() and a have a wrong column name / missing a required field I get the same error/failere.

Sep
04
4 months ago
Activity icon

Replied to Delete Request In Vue Js Using Axios An Sweet Alert

Hi @jet

I never used Falcon but give it a try/guess, is there a method delete in your AcademicSessionController controller and what is the code in this method?

Activity icon

Replied to Delete Request In Vue Js Using Axios An Sweet Alert

Hi @jet

Are there errors in your browser console? If there are no errors, what is the PHP code/method for api/academic-session/ + id ?

Sep
03
4 months ago
Activity icon

Replied to Did Laravel Carbon And Eloquent Has Or Do Like Subtime() In Mysql

Hi @chalahed

In Eloquent you can use the raw functionlity

$total = "49:00:00";
  $foo = "09:00:00";
  $users = DB::table('users')
    ->select(DB::raw('SUBTIME("' . $total . '", "' . $foo . '")'))
    ->get();

In Carbon, check the 'Addition and Subtraction' section https://carbon.nesbot.com/docs/#api-addsub