mlutz

mlutz

Member Since 3 Years Ago

Experience Points 10,230
Experience
Level
Lessons Completed 92
Lessons
Completed
Best Reply Awards 2
Best Answer
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.

08 Dec
3 days ago

mlutz left a reply on Date And Time Format With Api And Vue

Yeah, you made my day. It works. Yesterday I tried a similar solution. But unfortunately with the wrong variables.

Great support @realrandyallen !

Thanks markus

07 Dec
4 days ago

mlutz left a reply on Date And Time Format With Api And Vue

I've got an error, too.

:value="formatDate(newItem.tsmp)" conflicts with v-model on the same element because the latter already expands to a value binding internally

mlutz left a reply on Date And Time Format With Api And Vue

Many thanks for your reply.

I have problems in vue.

the form code has this row

<input type="text" class="form-control" v-model="newItem.tsmp" />

lumen delivers a timestamp. I have problems to convert the timestamp into german date.

This is not working:

<input type="text" class="form-control" v-model="newItem.tsmp | formatDate" />

Error: Property or method "formatDate" is not defined on the instance but referenced during render.

How can I solve this problem?

mlutz started a new conversation Date And Time Format With Api And Vue

Hi, i have trouble with the beginning with vue. I need a simple form with title, date and time. Only these three details are needed. But i need german date format (dd.mm.YYYY).

A possibility is working with unix timestamp. I save this in the database und transform it in the lumen backend and vue frontend. This looks very difficult. Specially with vue. Or is it better to use the date string in all areas?

28 Sep
2 months ago

mlutz started a new conversation Big Problems Mit Adldap And Windows Directory

Hello, I have trouble with adldap. I try to connect to a windows active directory.

The loginscreen from Laravel works with eloquent. If i switch to adldap, the login mask doesn't work. After submitting the mask remains without error. I found no hint in the logfiles.

This Code works in a "normal" Controller: ```$user = Adldap:auth()->attempt("joe","foo");```` I get a "true" and a "false" with wrong password.

In the Config-File "adldap_auth.php" I use the NoDatabaseUserProvider::class.

The array "username" uses at "ldap" the value 'samaccountname'.

Something is still wrong. I hope someone can help me.

Best regards

17 Sep
2 months ago

mlutz started a new conversation Laravel Passport With LDAP

Hello,

is it possible to use Laravel Passport with LDAP? (Authentication against Active Directory) How can I get that?

11 Aug
4 months ago

mlutz left a reply on Vue Post To Api And Catch Request With Controller

@tykus Many thanks. You made my day.

Great support and and patience. I don't know how I solved it by myself.

Best regards

mlutz left a reply on Vue Post To Api And Catch Request With Controller

dd($players);

Collection {#189
  #items: array:4 [
    0 => array:1 [
      1 => array:1 [
        "visit" => "X"
      ]
    ]
    1 => array:1 [
      2 => array:1 [
        "visit" => "X"
      ]
    ]
   ...
}

mlutz left a reply on Vue Post To Api And Catch Request With Controller

I've got an error:

"Array to string conversion (SQL: insert into "player_training" ("player_id", "training_id", "0") values (0, 1, X))

I think the player_id is wrong. It's really difficult.

mlutz left a reply on Vue Post To Api And Catch Request With Controller

@tykus Yeah, you are great.

Is it possible to use the sync option? The alternative is to delete everything before the update.

mlutz left a reply on Vue Post To Api And Catch Request With Controller

The pivot table has four fields: id player_id (Relation to player table) training_id (Relation to training table visit (Field for status)

The Vue form provides more data "id":1,"firstname":"Emma","lastname":"Gomez","tdate":"2018-03-03","visit":"X"

Thank you for your patience.

mlutz left a reply on Vue Post To Api And Catch Request With Controller

I have a many to many pivot table. The Fields: id player_id training_id visit

Currently, Laravel says I have more data in my post than fields (Undefined column).

This works only with Laravel. (But I changed the database). Controller:

....
$training = Training::find($id);
$training->players()->sync($spieler); 
...

If I did that ...

mlutz left a reply on Vue Post To Api And Catch Request With Controller

@tykus @Abi

Great! The first Problem is solved :) Many thanks.

Next problem is the database. I will try it.

mlutz started a new conversation Vue Post To Api And Catch Request With Controller

Laravel and Vue make fun. But at the beginning it's very difficult.

I want to post a form with axios to the api. This is the submitted payload:

[{"id":1,"firstname":"Emma","lastname":"Gomez","tdate":"2018-03-03","visit":"X"},{"id":2,"firstname":"Jacob","lastname":"Miller","tdate":"2018-03-03","visit":"D"}...

Vue:

saveForm() {
                axios.post('/api/training/'+this.$route.params.id+'', this.players)
                .then(response => { ...

Laravel Controller:

public function update(Request $request, $id)
    {
        $players = $request->players;

This ist my first problem. $request->players is empty.

How do I get access to the request?

The next problem we will be the database. But one after the other.

Best regards

10 Aug
4 months ago

mlutz left a reply on Form With Array - Problem With Select Options

Thanks for your reply.

This is new territory for me. How should I proceed?

mlutz started a new conversation Form With Array - Problem With Select Options

Hello, i need a form to edit some data. From the Api I receive the following data

[{"id":1,"firstname":"Emma","lastname":"Gomez","tdate":"2018-03-03","visit":"X"},{"id":2,"firstname":"Jacob","lastname":"Miller","tdate":"2018-03-03","visit":"D"}...

I would like to list the data and change the visit-state.

 <ul v-if="players">
            <li v-for="{ id, firstname, lastname } in players">
            {{ firstname }} {{ lastname }} 
                <select>
                <option value="X">Present</option>
                <option value="E">Excuse</option>
                <option value="D">Diseased</option>
                </select>
          </li>
        </ul>

```
My first problem: How can i list the received data?
The players are displayed. But the old Value is not selected and in the second step i want to save the changes to the api. 
Thanks for help.

07 Aug
4 months ago

mlutz started a new conversation Problems With Many To Many Relationship

Hi, i have a many to many relationship. This raw sql show the desired result:

FROM player_training
INNER JOIN players
ON players.id = player_training.player_id
WHERE training_id = 2```

How can i get the same result with eloquent?

I have three tables:
- players
- trainings
- player_training

I need the data from a trainingday.


20 Jul
4 months ago

mlutz started a new conversation Mixing Vue SPA With Laravel Routes

Hello everybody,

i want to start with vue. Is it possible to use Vue as a SPA and laravel for some routes?

Example: Vue catch the url: /player /player/id /player/scores

Laravel provides /news /photos /teams

Maybe someone knows a page that uses this?

13 May
6 months ago

mlutz left a reply on Laravel Passport - Only For Js?

Thanks for the reply.

Is it possible to use laravel as a client? I have a running passport server and the laravel application should use this for authentication. Is this possible?

mlutz started a new conversation Laravel Passport - Only For Js?

Hi, is it possible to use passport with laravel? Or is it restricted to javascript?

Probably is it not possible to mix passport with the default (session based) authentication?

24 Mar
8 months ago

mlutz left a reply on SPA With Laravel - Domain API

ok. Many thanks.

mlutz left a reply on SPA With Laravel - Domain API

I'm sorry. I want divide the frontend with the backend.

mlutz left a reply on SPA With Laravel - Domain API

Thanks for the reply.

I don't like to mix laravel or lumen with the spa. That's the reason why i don't divide laravel and angular or vuejs. Maybe there are other solutions? Is it possible to use to different folders? I have no opportunity to configure the webserver.

mlutz started a new conversation SPA With Laravel - Domain API

Hi, i would like to built a SPA. I use laravel or lumen for the backend. Perhaps Angular 5 or vuejs for the frontend. Is it better to use a subdomain for the api (api.xyx.com) or is it possible to use one domain for the complete webapplication? I want two separate applications. Which solution is suitable? Any hints?

best regards markus

15 Feb
9 months ago

mlutz left a reply on Raw Sql-select

It's allright. @Snapey answer the question about the eloquent model.

I use Carbon for the date format and now i'm happy.

Thank you for your help

best regards markus

mlutz left a reply on Raw Sql-select

@bobbybouwmann

Here is the working select:

 $massage = DB::table('courses')
        ->selectRaw("*,
                    (SELECT COUNT(*)
                    FROM appointments
                    WHERE p ='x'
                    AND appointments.id = course.id
                    GROUP BY course_id
                    ) as fp")->get();

mlutz left a reply on Raw Sql-select

Thanks for your reply. I tested the "selectRaw". The query received a value. So the first step works. :)

But the next problem is the date format. The get attribute in the model seems to be ignored. The date format is wrong. Am i right, the the attribute works only with eloquent?

14 Feb
9 months ago

mlutz started a new conversation Raw Sql-select

Hello,

i have a problem with a raw SQL-select. This Code works in Laravel 5.2:

$massage = DB::table('course')
                     ->select(DB::raw("*,
                            (SELECT COUNT(*)
                             FROM appointments
                             WHERE p ='x'
                             AND appointments.id = course.id
                             GROUP BY A_id
                             ) as fp,
                    ...
            ...
                            "))->get();

I've got a value for the the variable "fp".

With Laravel 5.5 the value "fp" is empty.

With the raw-select the get and set attributes in the model doesn't work, too.

For a better understanding: I have a table with sport courses. The table course has a many relation to the table appointments. I need the count of the booked appointments.

How can i solve my problem?

Best regards Markus

10 Jan
11 months ago

mlutz left a reply on Json Output - Wrong Order - Eloquent

this works for me: $roles = Role::orderBy('id')->get();

many thanks tykus.

mlutz started a new conversation Json Output - Wrong Order - Eloquent

Hello,

i have a problem and i don't know where it is.

My Controller has a function to get all roles.

$roles = Role::all()->sortBy("id");
dd($roles)

Output:
 #items: array:6 [▼
    0 => Role {#293 ▶}
    1 => Role {#294 ▶}
    4 => Role {#297 ▶}
    5 => Role {#298 ▶}
    2 => Role {#295 ▶}
    3 => Role {#296 ▶}
  ]

The json-output has the wrong sorting. I need this sequence: 0 =>... 1 => ... 2 => ... 3 => ... 4=> ... Changing the the sortby option does not help. The Keys are always the same. Why?

How can i solve this problem?

best regards. markus

20 Aug
1 year ago

mlutz started a new conversation Which Relationships Is The Right One For Me?

I have the following plan: There is a team in the tennis club. I would like to record the training visits. I have a table player. Finally, I would like to evaluate the visits from every player. Or the trainingday with the most players.

Which is the correct Relationship for my purpose? Is it one to many or many to many?

03 Aug
1 year ago

mlutz left a reply on Format Date - Json Output

thanks for the reply.

I need the query bilder for a complex select.

Is it possible to format the date in the sql select? I use postgresql. Any Ideas?

mlutz started a new conversation Format Date - Json Output

I have problems with date-format in json-output.

In the model i use an accessor '''' public function getdatumAttribute($value) { return Carbon::parse($value)->format('d.m.Y'); } ''' With eloquent this works fine. I've got the correct format of the datefield.

If i use the select: '''' $player = DB::table('players')->select(DB::raw("*, .... .... return $player; '''' the accessor doesn't work und the output of any date is wrong (for me). Why does the accessor not work with the db-select and how can i format the date in json output?

best regards

27 Jun
1 year ago

mlutz started a new conversation Authentication Class For Passport

How can i check if the user is authenticated? With the right user and password the user gets a token. I save with

 localStorage.setItem('currentUser', JSON.stringify(responseData));

Now i need a class to check if the user is authenticated. Has someone an example?

mlutz left a reply on Laravel Boilerplate On Hosting Server: Error -> Public/login Was Not Found On This Server.

Perhaps the RewriteBase is not correct. Try a comment out.

09 Jun
1 year ago

mlutz left a reply on Architecture With Laravel And Vue

thanks for your reply.

but are both ways practicable?

Is it better to use laravel with a single vue component or a complete single page app? What disadvantages result from the two options?

08 Jun
1 year ago

mlutz started a new conversation Architecture With Laravel And Vue

Hello, i'm interested in learning vue. I need a hint to use vue with laravel.

Normally there is a api. eg: /api/player /api/club

In the front end I want to use vue to show the data. e.g. /player and /club and more...

How will it work in practice? Is there one single page with vue (one script with routing)? Or is it possible to use a separate vue script for every page?

regards markus

07 Jun
1 year ago

mlutz left a reply on Laravel Passport Api With Laravel

Thanks. I'm searching for a tutorial with example code. Passport is running fine und i can use it with postman. But how can i use passport with laravel. Is it possible? Or is the better to use passport (authentication) with a js framework?

mlutz started a new conversation Laravel Passport Api With Laravel

I am searching for a tutorial to use laravel with passport. Is it possible to use passport with laravel or is it better to use javascript (angular, vue ...).

08 Feb
1 year ago

mlutz left a reply on Just Combine Js-files

Yeah, this works. npm runs without an error.

But without the npm-manager there is no chance to combine the files? In the best case i manage the files by myself.

Other Tools like Bower are out of the box in 5.4?

mlutz left a reply on Just Combine Js-files

Hi Jeffrey,

i tried it with ''' const { mix } = require('laravel-mix'); mix.js([ 'resources/assets/vendor/jquery-2.2.4.js', 'resources/assets/vendor/materialize-src/js/bin/materialize.js' ], 'dist/app.js'); ''' too but the same error: ''' ERROR Failed to compile with 1 errors

This dependency was not found in node_modules:

  • hammerjs '''

hammerjs is required by materialize.js, but it's included in the complete file of materialize. Perhaps it's better to use a task manager like gulp?

best regards markus

mlutz started a new conversation Just Combine Js-files

Hi, i just want to combine two js files.

My webpack.mix.js file: ''' mix.combine([ 'resources/assets/vendor/jquery-2.2.4.js', 'resources/assets/vendor/materialize-src/js/bin/materialize.js' ], 'dist/app.js'); '''

I've got an error: This dependency was not found in node_modules:

  • hammerjs

Is it possible to combine this two files without a check from webpack?

06 Feb
1 year ago

mlutz left a reply on 5.4 - Mix - Javascript

Thanks. I've got it.

mlutz started a new conversation 5.4 - Mix - Javascript

Hello, i have problems to understand the new laravel mix. I want to put some Librarys (jquery, jquery-plugins) in one file. In another file the satisfy code. With gulp it was easy with "mix.scripts". I have a bower directory with some plugins. And now?

30 Jan
1 year ago