mvd

Member Since 3 Years Ago

Leusden

Experience Points 60,780
Experience Level 13

4,220 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 310
Lessons
Completed
Best Reply Awards 46
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.

22 Jul
10 hours ago

mvd left a reply on HTML Name Attribute Vs Vue V-model

Hi @untymage

The name attribute is used to reference elements in a JavaScript, or to reference form data after a form is submitted.

https://www.w3schools.com/tags/att_form_name.asp

16 Jul
6 days ago

mvd left a reply on How To Showing Data On Blade With Pass Through 2 Table FK

@adhik13th it's hard to see what is wrong without code. Can you give us the relations (code) ?

mvd left a reply on How To Showing Data On Blade With Pass Through 2 Table FK

Hi @adhik13th

You pass the $practice variable/query result but in your view you use $riwayat

mvd left a reply on ES6 Features Like Arrow Function, Array.from() Not Working After Compiling Js Files With LaravelMix.

Hi @coachthem

Array.from not supported in IE 11 (and earlier versions), got an older IE browser?

But this will help you.

Array.from() was added to the ECMA-262 standard in the 6th edition (ES2015); as such it may not be present in other implementations of the standard. You can work around this by inserting the following code at the beginning of your scripts

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill

10 Jul
1 week ago

mvd left a reply on How To Use Vars In *.vue Files From _variables.scss ?

@mstdmstd

Try this, replace

<style scoped>
    .element {
        color: $text-color;
    }

</style>

with:

@import "./resources/sass/_variables.scss"; .element { color: $text-color; }

Does this work?

08 Jul
2 weeks ago

mvd left a reply on Seed Factory And Pivot Table

Hi @mostafalaravel

Do you have a factory created voor the groups ?

04 Jul
2 weeks ago

mvd left a reply on Problem With Running The Application From The Server With Debian 8.3

@pol_php I don't have much server experience but maybe this article will help you ?

Enable PHP 7.2 as Default

https://tecadmin.net/switch-between-multiple-php-version-on-debian/

mvd left a reply on Importing Node_Modules (Like FontAwesome)

@lordbedwetter np, i did this steps to use Font Awesome in a project. But does it not work?

mvd left a reply on Problem With Running The Application From The Server With Debian 8.3

Hi @pol_php

If I check this file and line I see

 return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);

The ?? is available since PHP 7.0 so I guess there is also anotherPHP version (< 7) running. Can you check which PHP version is running? You can do this in the code, file public/index.php and on top

<?php
echo phpversion();
die;

Open the app and you will see the PHP version.

mvd left a reply on Importing Node_Modules (Like FontAwesome)

Hi @lordbedwetter

You can import the scss file into your scss files (resource/sass)

@import "node_modules/font-awesome/scss/font-awesome.scss";

And run

npm run dev
03 Jul
2 weeks ago

mvd left a reply on No Data Is Showing From Db

@incridible thanks and i see the 'problem'. Example file with id 1 is 'Aanzi Hajar_....' but the name (user, 3) is 'Hajar' so the name is not started with 'Aanzi' = no match.

If you don't only want to match on the beginning of the name you can remove the ^ in the check. Change it to:

@if (preg_match("/" . Auth::user()->name . "/", $file->filename))

mvd left a reply on No Data Is Showing From Db

Can you also post the filenames?

mvd left a reply on No Data Is Showing From Db

@incridible now you are check if the users emailadress is literally 'filename'

I think i see what you want to check, you want to check if the beginning of the filename is the username? Better approach is to do this:

<div class="form-group">
              <form oninput="this.submit()">
                <label class="text-left">Select Student</label>
                @auth()
                    <select name="Student" id="Student" style="padding: 5px; border-radius: 3px;">
                      <option value="">Select Student</option>
                      @foreach ($files as $file)
            @if (preg_match("/^" . Auth::user()->name . "/", $file->filename))
                      <option value="{{ $file->id }}">{{ $file->filename }}</option>
            @endif
                      @endforeach
                    </select>
                @endauth
              </form>
            </div>

mvd left a reply on No Data Is Showing From Db

@incridible what you are doing is checking if the username is filename but you don't have a (user) name filename. Only (Amin, Hajar, Abdelrahman, Saeed, Zakariya)

mvd left a reply on No Data Is Showing From Db

@incridible thanks but you do a check if the name (column 'name' from table 'users') is literally filename, i think there a no user with the name 'filename'?

mvd left a reply on Do A Task For Users On A Much Lower Interval

@joveice that could be an option, with a cron job.

who can see the energy level? I f only a user can see his/her own energy level and users are not very active you could do

  • Log the timestamp when a user visit a page
  • On the next page request calculate the diff in seconds from the current timestamp with the logged timestamp and update the energy level.

mvd left a reply on No Data Is Showing From Db

@incridible You do a check for username, @if (Auth::user()->name == 'filename') But i assume your uername is not really 'filename' ?

mvd left a reply on No Data Is Showing From Db

Can you give us the updated blade file?

mvd left a reply on Use Of Undefined Constant Filename - Assumed 'filename' (this Will Throw An Error In A Future Version Of PHP)

Hi @incridible

I don't know where you get the error (in which piece of code) But this piece is not right

@if (Auth::user()->name == filename)

If think you need to use $filename or with quotes 'filename'

mvd left a reply on Access Relationship From Inside A Where Clause (or However I'm Supposed To Do This)

Hi @hunterhawley

I'm not 100% sure and not tested but hope you get an idea to get you started. You can set another relationship from a child relationship, example

->with('stats.stat_meta')

In your stats model create a relationship to stat_meta with method name stat_meta, example

function stat_meta() {
    return $this->hasMany(StatMeta::class);
}

If you want to filter on the stat_meta you could do something like

$games = App\Game::with(['stat.stat_meta' => function($q) { $q->where('stat_name', 'assist'); }]))->get();

02 Jul
2 weeks ago

mvd left a reply on How To Make Dynamic Menu Not Clickable

@me10071990, @snapey 's code should work. What code do you have now?

01 Jul
3 weeks ago

mvd left a reply on Test Case Can't Open File In Public Directory?

Hi @uccdev

fopen("courses.csv", "r");

You need to set the path, https://www.php.net/manual/en/function.fopen.php

fopen(public_path('courses.csv'), "r")

mvd left a reply on How To Make Dynamic Menu Not Clickable

Hi @me10071990

Can you show us how you create the menu (blade file)?

mvd left a reply on How To Modify Relationships Loaded Using With()

Hi @doctolly,

I never used presenters but does this work?

$staff = $duties->staff->present(StafPresenter::class);
27 Jun
3 weeks ago

mvd left a reply on Want To Post The Data In My Dynamic Category Through Another Form, Is It Possible?

@me10071990 thanks

So you know the parent and you want a select input to select the childs? If this is the case.

In your controller for example (don't know if you have a model for the categories).

// Get the childs from the database
$childCategories = Categories::where('parent_id', selectedCategory)->get();

return view('another_form', compact('childCategories ');

In your form

<select name="child_category">
     @foreach($childCategories as $category)
              <option value="{{ $category->id }}">{{ $category->name}}</option>
         @endforeach
</select>

mvd left a reply on Want To Post The Data In My Dynamic Category Through Another Form, Is It Possible?

@me10071990 how do you store the categories? Does a subcategory also got a unique id for example?

26 Jun
3 weeks ago

mvd left a reply on Invalid Argument Passed

@ALIYA - @aliya

dd($data['skill']); It gives result Likes :- B.edM.edNTT

This is not a array, and implode needs a array as second param.

mvd left a reply on Want To Post The Data In My Dynamic Category Through Another Form, Is It Possible?

@me10071990

Hmm do you mean you dont want the but just a one $categoryOptions based on ````$selectedCategory`````

You can this by

$selectedSubCategory = $categoryOptions [$selectedCategory ];

But you see there are more indexes with the same id (7 x 0, 3 x 4 and 3 x 6) so make your index for the $categoryOptions unique.

mvd left a reply on Invalid Argument Passed

@ALIYA - Can you give us the whole file code where you set this implode. And give us the output of $data['skill']

dd($data['skill'])

mvd left a reply on Invalid Argument Passed

Hi @aliya

And how can we help you without knowing your code?

mvd left a reply on Want To Post The Data In My Dynamic Category Through Another Form, Is It Possible?

@me10071990 hmmm no not really because you can't have children in a select. You can do a sort of workaround with a '-' before a child. Parent 1 Parent 2

  • child 1 for parent 2
  • child 2 for parent 2 Paren 3
  • child 1 for parent 3

But a pretty solution is to create a select with just the parants and if you pick one, show another select with the children from the selected parent.

Example, https://jsfiddle.net/hibbard_eu/yb0koLdc/

and when trying with and showing also "compact(): Undefined variable: selectedCategory " I think you don't you have a $selectedCategory in your controller ?

mvd left a reply on Want To Post The Data In My Dynamic Category Through Another Form, Is It Possible?

Hi @me10071990

Something like this?

In your controller to call 'another form'

$selectedCategory = 5;
        $categoryOptions = array(
            1 => 'home',
            2 => 'contact',
            3 => 'about',
            4 => 'youth',
            5 => 'people',
            6 => 'peace',                
        );
return view('another_form', compact('selectedCategory ', 'categoryOptions'));

I asome the categories is a select

  <select name="category">
     @foreach($categoryOptions as $index => $option)
              <option value="{{ $index }}" @if($index == $selectedCategory) selected @endif>{{ $option }}</option>
         @endforeach
</select>

mvd left a reply on Password Validate Rules

Hi @phphupptechnologies

In file app\Http\Controllers\Auth\RegisterController.php method validator

The validator for the password, only for the repeating chars (don't know it for the following)

 'password' => ['required', 'string', 'min:8', 'confirmed', 'regex:/^(?!.*(\w){1,}).+$/'],
25 Jun
3 weeks ago

mvd left a reply on Regarding Video Integration

@deekshith

There are some api to do that (but my solutions are not really good/user friendly) https://github.com/vimeo/vimeo.php#uploading-videos and a Laraval package https://github.com/vimeo/laravel

24 Jun
4 weeks ago

mvd left a reply on Regarding Video Integration

Hi @deekshith,

Your solutions will unfortunately not work because the only real protection is the domain validation. If someone know the source, he/she can always access the video.

You could set a password protection on the video's with the api every x time and notify a user when he/she logs in for the new password....but that is not very user friendly ;) Or delete and insert the video's every x time with the api and update the url in your db...also not a good approach.

18 Jun
1 month ago

mvd left a reply on A User Has A Profile Episode Test Fail Due To Certain Usernames, Works In Browser For Names Without Special Character.

@harshitbatra

Whats is the user name where you get a 'not found page' ? And can you give us the user factory code?

mvd left a reply on Add An Array Of Data To The Database

Hi @gaan10

hospital_incharge_referred is your model?

Try

for($count = 0; $count < count($Patient_Name); $count++)
      {
       $data = array(
          'Patient_Name' => $Patient_Name[$count],
          'Mobile'  => $Mobile[$count],
          'Surgeon' => $Surgeon[$count],
          'Amount'  => $Amount[$count]
          );

          hospital_incharge_referred::insert($data);
      }

mvd left a reply on How To Create Send Code Again?

@irankhosravi

You are not closing {{ route('sendAgainCode')}}, closing " is missing.

And you set a get request (link to a page = get request) and in your router file you defined a post

Change the router request to

Route::get('/send-again-code', '[email protected]')->name('sendAgainCode');

mvd left a reply on How To Create Send Code Again?

@irankhosravi a clear, can you give is the blade/source template where you set 'Send code again' link/button?

mvd left a reply on A User Has A Profile Episode Test Fail Due To Certain Usernames, Works In Browser For Names Without Special Character.

@harshitbatra what you can do is change the factory to create a dummy user to avoid the dots.

In file database/factories/modelfactories.php (or in newer versions, UserFactory.php), change

$factory->define(User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,
    ....

to

$factory->define(User::class, function (Faker $faker) {
    return [
        'name' => $faker->firstName . ' ' . $faker->lastName,
    ....

mvd left a reply on A User Has A Profile Episode Test Fail Due To Certain Usernames, Works In Browser For Names Without Special Character.

@harshitbatra

I think because the dot (special char) in the name, can you check if this is the case?

mvd left a reply on How To Create Send Code Again?

@irankhosravi and if you change

<form action="{{ route('send') }}" method="post">

to

<form action="{{ route('sendAgainCode') }}" method="post">

?

mvd left a reply on How To Create Send Code Again?

@irankhosravi because we don't know what the form action is.

Can you give us the template source/blade code for this form?

mvd left a reply on Spatie Crawler Just Loads Forever

Hi @kakallatt

Set a maximal crawl count?

By default, the crawler continues until it has crawled every page of the supplied URL. If you want to limit the amount of urls the crawler should crawl you can use the setMaximumCrawlCount method.

// stop crawling after 5 urls

Crawler::create()
    ->setMaximumCrawlCount(5)

https://github.com/spatie/crawler

13 Jun
1 month ago

mvd left a reply on How To Send Value From Dropdown To The Controller Via Ajax ?

@phoenix5 you need to post the value with ajax (or add the value in a hidden value and post a form).

Something like (not tested)

$('.dropdown-menu- li a').on('click', function() {

    var selectedValue = $(this).text();
    var id = 1; //1 is just for testing,  you need to get the id somewhere with ajax.
        $.ajax({

           type:'POST',

           url:'/ajaxRequest',

           data:{produit:id, modele:selectedValue },

           success:function(data){

              alert(data.success);

           }

        });
});

Route

Route::post('ajaxRequest', '[email protected]');

In your controller

    public function ajaxPost(Request $request)

    {
$data = Input::all();

        $pr = new Produit([
                    'produit'              => $data['produit'],
                    'modele'               =>  $data['modele'],
                    ...
                ]);
 $pr->save();

    }

mvd left a reply on If Condition Cant Work

@van1310, ofcourse $interviewschedule is a collection, try this

@if(empty($interviewschedule)) 
    Data empty
@elseif($interviewschedule->first() == "basic")
        Has Basic Data
@else
        False
@endif

mvd left a reply on If Condition Cant Work

Hi @van1310

I think interviewschedule is already your round_type variabele And your ifelse check does not work, i changed this for tou.

Can you check if this work?

@if(empty($interviewschedule)) 
    Data empty
@elseif($interviewschedule == "basic")
    Has Basic Data
@else
    False
@endif