torriv

torriv

Member Since 5 Months Ago

Experience Points
480
Total
Experience

4,520 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
1
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 1
480 XP
Mar
26
2 weeks ago
Activity icon

Started a new Conversation Homestead With Type NFS Not Working

windows 10 pro
Laravel/homestead version: 9.3.0
VirtualBox version: 6.0
Vagrant version: 2.2.6

i've been trying to fix this this whole day now and can't figure it out.

i had all my projects in one homestead environment, and everything worked fine. But i decided to go for "per projects" installation instead of homestead.

i've got all projects up and running. But i can't get NFS to work. (it worked when i had all projects under same homestead).

i've tried many tutorials and suggestions i could find on google...

i've successfully installed vagrant-winnfsd plugin. and i set det settings in "homestead.yaml" to

folders:
    -
        map: 'path\to\project'
        to: /home/vagrant/code
        type: "nfs"

the Error i get when i try to vagrant up --provision is:

................
==> bpa: Exporting NFS shared folders...
==> bpa: Preparing to edit nfs mounting file.
[NFS] Status: halted
[NFS] Start: started
==> bpa: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp,actimeo=1,nolock 192.168.10.1:/D/SynologyDrive/Prosjekter/Privat/bpa /home/vagrant/code

Stdout from the command:



Stderr from the command:

mount.nfs: an incorrect mount option was specified

Does anyone have any suggestions to what can be wrong or how to fix this?

Mar
01
1 month ago
Activity icon

Replied to Vue Push

I feel i'm pretty close now.

  1. If a date exists, it works.

  2. If a date doesn't exists, i've manage to make the array (using vue dev tools to make sure), but it doesn't update the page with the new data.

code:

if (this.unavailable[date]) {

        this.unavailable[date].push({
          id: unavailable.id,
          fra_dato: unavailable.fra_dato,
          til_dato: unavailable.til_dato,
          description: unavailable.description,
          user_id: unavailable.user_id,
          unavailable: 0,
          allDay: unavailable.allDay,
          user: {
            name: unavailable.name
          }
        });

      } else {
          
        this.unavailable[date] = [
          {
            id: unavailable.id,
            fra_dato: unavailable.fra_dato,
            til_dato: unavailable.til_dato,
            description: unavailable.description,
            user_id: unavailable.user_id,
            unavailable: 0,
            allDay: unavailable.allDay,
            user: {
              name: unavailable.name
            }
          }
        ];

      }
Feb
29
1 month ago
Activity icon

Replied to Vue Push

Thanks! That worked. however, it only works when i already have an array with that date from before.

if the array is empty, i get the error "TypeError: Cannot read property '01.03.2020' of undefined"

some more code:

  data: function() {
    return {
      unavailable: ''
    };
  },
  created() {
    EventBus.$on("new-unavailable-day-time", unavailable => {

      let date = moment(unavailable.fra_dato, "DD.MM.YYYY HH:mm:ss").format(
        "DD.MM.YYYY"
      );

      this.unavailable[date].push({
        id: unavailable.id,
        fra_dato: unavailable.fra_dato,
        til_dato: unavailable.til_dato,
        description: unavailable.description,
        user_id: unavailable.user_id,
        unavailable: 0,
        allDay: unavailable.allDay,
        user: {
          name: unavailable.name
        }
      });
    });
  },
Activity icon

Started a new Conversation Vue Push

hi all,

i'm trying to push values after submitting.

I've made it work on all other ocassions, but this time the structure is a little bit different.

it should be like this:

{
   "29.02.2020":[
      {
     "id":467,
         "fra_dato":"29.02.2020 17:40",
         "til_dato":"29.02.2020 19:40",
         "description":"",
         "user_id":17,
         "unavailable":0,
         "allDay":null,
         "user":{
            "name":"Driscoll Nguyen"
         }
      }
   ]
}

what i get (doesn't work)

[
   {
      "29.02.2020":{
         "id":467,
         "fra_dato":"29.02.2020 17:40",
         "til_dato":"29.02.2020 19:40",
         "description":"",
         "user_id":17,
         "unavailable":0,
         "allDay":null,
         "user":{
            "name":"Driscoll Nguyen"
         }
      }
   }
]

here is a js fiddle to show more what i'm trying to achieve: https://jsfiddle.net/r5wjm08y/3/

code i'm using: (the date will be dynamic, but hardcoded here for testing purposes)

      this.unavailable.push({"29.02.2020":{
        
            id: unavailable.id,
            fra_dato: unavailable.fra_dato,
            til_dato: unavailable.til_dato,
            description: unavailable.description,
            user_id: unavailable.user_id,
            unavailable: 0,
            allDay: unavailable.allDay,
            user: {
              name: unavailable.name
            }
      }});
Feb
28
1 month ago
Activity icon

Replied to Vue V-for On An Object

awesome! thank you! :)

Activity icon

Replied to Vue V-for On An Object

Thanks for answering!

look at this fiddle:

https://jsfiddle.net/umgcdjey/

it's just a simplified version, but the data is exactly as i get it (just changed values to dummy data).

but you can see what i have tried last time with no luck.

Activity icon

Started a new Conversation Vue V-for On An Object

hi all!

I just "discovered" vue a couple of weeks ago an figured out i wanted to change some of my Laravel code with vue. so bare in mind that i'm pretty new on vue.

i've been working on an issue the last days.

what i want is to print out a list of dates where an emplyee can't work.

the list would look something like this:

28.02.2020

empoyee 1: 14.00 - 16.00
empoyee 2: 08.00 - 12.00

29.02.2020 - 30.02.2020 (all day events)

employee 1: leaves 08.00
              back 14.00

before i changed to Vue, i could do this with foreach and some if and else and so on.

i changed my query so it returns data ordered by dates.

Data recieved:

{
   "28.02.2020":[
      {
         "id":403,
         "fra_dato":"28.02.2020 09:00",
         "til_dato":"28.02.2020 23:55",
         "description":null,
         "totalt":895,
         "user_id":17,
         "unavailable":0,
         "allDay":null,
         "created_at":"2020-02-28 23:10:34",
         "updated_at":"2020-02-28 23:10:34",
         "deleted_at":null,
         "user":{}
      },
      {
         "id":402,
         "fra_dato":"28.02.2020 21:30",
         "til_dato":"28.02.2020 23:45",
         "description":null,
         "totalt":135,
         "user_id":4,
         "unavailable":0,
         "allDay":null,
         "created_at":"2020-02-28 21:01:56",
         "updated_at":"2020-02-28 21:01:56",
         "deleted_at":null,
         "user":{}
      }
   ],
   "29.02.2020":[
      {
         "id":398,
         "fra_dato":"29.02.2020 17:00",
         "til_dato":"01.03.2020 21:00",
         "description":"jepp",
         "totalt":1680,
         "user_id":17,
         "unavailable":0,
         "allDay":1,
         "created_at":"2020-02-28 02:20:46",
         "updated_at":"2020-02-28 02:20:46",
         "deleted_at":null,
         "user":{}
      }
   ]
}

the biggest issue is that i can't get to output anything at all... ( i also get an error that it can't read property id of undefined)

in my vue file, in template, i have this code:

<ul>
<li v-for="(value, index) in unavailable" v-bind:key="value.id">{{value}}</li>
</ul>   
Jan
13
2 months ago
Activity icon

Replied to Many Queries Even When Using With()

changing from u to U fixed it!! from 14 queries to 6!

Thanks!

And the role is there because i have protected $with = ['roles']; in my user model.

Activity icon

Started a new Conversation Many Queries Even When Using With()

So as the title says, it runs multiple queries even if i'm using with()... and i can't figure out why.

i'm having this query in my controller:

$this->timesheet->with('Users')->where('from_date', '>', now())->get() 

in my view i have this:

@each('home.work', $upcomingWork, 'uw', 'home.noWork')

in home.work view on the line that runs multiple times i have this:

<a class="kt-widget-13__title" href="#">{{$uw->users->name}}</a>

it runs these queries for each iteration:

select `roles`.*, `role_user`.`user_id` as `pivot_user_id`, `role_user`.`role_id` as `pivot_role_id` from `roles` inner join `role_user` on `roles`.`id` = `role_user`.`role_id` where `role_user`.`user_id` in (4)


select * from `users` where `users`.`id` = 16 and `users`.`deleted_at` is null limit 1

any ideas?

Oct
17
5 months ago
Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

sorry, a little sloppy reply.

app/Console/Commands/

app/Console/Kernel.php

so the uppercase should be correct.

Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

yes i did.

app/console/commands/

app/console/kernel.php

that's how the console directory looks now.

Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        $this->load(__DIR__.'/Commands')
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
    }

    /**
     * Register the Closure based commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        require base_path('routes/console.php');
    }
}
Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

when removing semi colon, i got this error when trying to run php artisan command: Fatal error: Constant expression contains invalid operations in D:\wamp64\www\life\app\Console\Kernel.php on line 15

Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        $this->load(__DIR__.'/Commands');
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
    }

    /**
     * Register the Closure based commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        require base_path('routes/console.php');
    }
}
Activity icon

Replied to Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

no, it's an existing project. I'm not sure when it happened since i hadn't used the php artisan comman in awhile and done several updates on my code. (mostly in controllers and views)

Activity icon

Started a new Conversation Parse Error: Syntax Error, Unexpected ';', Expecting ']' In App\Console\Kernel.php On Line 16

I'm not sure how I can troubleshoot this one.

I'm using laravel 5.5.48 and PHP 7.3.*

it happens every time I use any PHP artisan command.

can anyone help?

thanks!