baeckerman83

baeckerman83

Member Since 5 Months Ago

Experience Points 3,090
Experience Level 1

1,910 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 24
Lessons
Completed
Best Reply Awards 0
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.

14 Apr
3 months ago

baeckerman83 left a reply on V-for Use Value In V-show In Other Tag - Possible?

My code is ok, there was an error at another code row.

baeckerman83 started a new conversation V-for Use Value In V-show In Other Tag - Possible?

Hi! How can I use the value (item in the example) in the i html tag? I need it there in the v-show.

This is how I tried, put it didn't work.

                <th scope="col" v-for="(item, key) in tableHead(myArr)" :key="key" @click="handleSortClick(item)">
                    {{item}}
                    <i v-show="sortObj[item]['up']" class="fas fa-sort-amount-up fa-flip-vertical"></i>
                    <i v-show="sortObj[item]['down']" class="fas fa-sort-amount-up"></i>
                </th>
06 Apr
3 months ago

baeckerman83 left a reply on Sort Array -> Why Does This Work?

Thank you Ricardo for your tip. I'll change this.

05 Apr
3 months ago

baeckerman83 started a new conversation Sort Array -> Why Does This Work?

Hi! I want to sort a multidimensional array. This works fine in my component. But I don't know why. Because I dont asign the sorted array to this.myarr but in the browser the table is sorted after I click on the table header.

<template>
    <div>
        <table class="table">
            <thead>
                <tr>
                <th scope="col"></th>
                <th scope="col" @click="handleSortClick(1)">1</th>
                <th scope="col" @click="handleSortClick(2)">X</th>
                <th scope="col" @click="handleSortClick(3)">2</th>
                </tr>
            </thead>
            <tbody>
            <tr v-for="item in myarr">
                <th scope="row">{{item[0]}}</th>
                <td :class="{ 'table-success': item[1]==getMinOffArr(myarr,1), 'table-danger': item[1]==getMaxOffArr(myarr,1) }">{{item[1]}}</td>
                <td :class="{ 'table-success': item[2]==getMinOffArr(myarr,2), 'table-danger': item[2]==getMaxOffArr(myarr,2) }">{{item[2]}}</td>
                <td :class="{ 'table-success': item[3]==getMinOffArr(myarr,3), 'table-danger': item[3]==getMaxOffArr(myarr,3) }">{{item[3]}}</td>
            </tr>
            </tbody>
        </table>
    </div>
</template>

<script>
    function sortMultiArray(arr, idx){
        arr = arr.sort(function(a,b) {
            return a[idx] - b[idx];
        });
        return arr.reverse();
    }

    export default {
        props: ['myarr'],
        methods: {
            handleSortClick: function(idx) {
                sortMultiArray(this.myarr, idx);
            }
        }
    }
</script>
20 Mar
3 months ago

baeckerman83 started a new conversation JS Function In Laravel For Vue2?

Hi! I've a js function for determine the min / max value of an array. I want to use this function getMinMax(arr, idx) in every Compoment or Class. But if I write the function in app.js it's not working. I inserted my function after the comment

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */

Where does my function belong so that I can use it everywhere in the code also in the vue compoment template section?

19 Mar
3 months ago

baeckerman83 left a reply on Vue2 -> ExampleComponent With Variable

Okay I understand, that I didn't need the @.

But I don't understand the second part. Because I thought I use a prop

baeckerman83 started a new conversation Vue2 -> ExampleComponent With Variable

Hi! I'm learning vue2 (together with Laravel). Now I've a problem passing a String to the Exampel Component. ` Example Component

                <div class="card-body">
                    @{{ testben }}
                    I'm an example component.
                </div>
            </div>
        </div>
    </div>
</div>

export default { props: ['testben'] } `

There is my variable testben, but in the browser I only see the @ , I thought I would see the value of testben.

What is wrong with my js?

` import examplecomponent from './components/ExampleComponent.vue';

const app = new Vue({ el: '#app', data: { testben: "Hallo" }, methods: { handleClick: function(id) { this.testben="Auf Wiedersehen!"; }); } }, components: { examplecomponent } }); `

18 Mar
4 months ago

baeckerman83 started a new conversation Route For Show Not Working

Hi! I tried: Route::apiResource('v1/odds', 'FixtureController'); in the api.php File. When I then insert localhost/api/v1/odds/1 in my browser, the return is empty.

if I change this to Route::apiResource('v1/fixture', 'FixtureController');

the return has the fixture in it.

My controller: public function show(Fixture $fixture) { var_dump($fixture); return "Hello"; }

Why does this only work with the key word fixture in the URL? Where is the connection between URL and Controller? How can I change this?

02 Mar
4 months ago

baeckerman83 started a new conversation Collection Min / Max

Hi! I try to use min / max on Collections. In my Collection are 1700 Entrys. An they are in 30 categories. So I need the min / max for every categorie. But this takes more then 60 seconds. Is this normal?

I used

        foreach ($my->unique('market_id')->pluck('market_id') as $market_id) {
            foreach ($my->where('market_id', $market_id)->unique('my_label')->pluck('my_label') as $my_label) {
                $minOdd=$my->where('market_id', $market_id)->where('my_label', $my_label)->min('my_value');
                $maxOdd=$my->where('market_id', $market_id)->where('my_label', $my_label)->max('my_value');
            }
        }
ยดยดยด

I get all the entrys from a datebase. I need the min / max to mark the min / max with colors on the webpage.
27 Feb
4 months ago

baeckerman83 left a reply on Button To Open Menu

Found the solution, need to use Vue.set so with Vue.set(this.cityShow, country, !this.show(country)); all is working is expected.

baeckerman83 left a reply on Button To Open Menu

So I first have to initialize the object with the country key? I can't do this dynamicaly? Because the countries are from a datebase.

baeckerman83 left a reply on Button To Open Menu

This is not working, I get [Vue warn]: Error in render: "TypeError: cityShow is not a function". So I thought the () was wrong and used [] but nothing happens. In the log, the variable cityShow['dk'] changes to true, but the two buttons are not shown.

26 Feb
4 months ago

baeckerman83 started a new conversation Button To Open Menu

Hi! I'm new to VUE2. So I know PHP, JS, Jquery... but now I try to learn Laravel and VUE2.

No I've my first question for VUE2 and hope you can help me. I've a Button which should show other buttons.

Denmark Billund Kopenhagen

This is the first part. Because the country and citys are coming from the database, this is dynamic.

This is my JS: const app = new Vue({ el: '#app', data: { cityShow: new Object(), }, methods: { getCountry: function(country){ this.cityShow['LL']=false; if (!this.cityShow.hasOwnProperty(country) ) { this.cityShow['DK']=false; return false; } return this.leagueShow['DK']; } } });

The false part is working and in the VUE Developer box I can see the object. Also I can change the object to true. But then nothings changes. I think this is, because the method is not called again. What must I do? Where can I found some informations?

20 Feb
4 months ago

baeckerman83 started a new conversation Route -> Get Path Like In Route?

Hi! When I use Route::resource('photos', 'PhotoController');

in my Route file, I also kan use photos/create, photos/1 and so on. Can I get the path original like in the route file? So if the user tips in photos/create I only would like to have photos in the variable. With Route::getCurrentRoute()->getPath(); I get the full path photos/create But I need id like in the web.php file. Is this possible?

19 Feb
4 months ago

baeckerman83 left a reply on Use Component In Other Component

I found the solution by my self. Under: https://laravel.com/docs/5.7/blade#components-and-slots I found the named slots, thats working for me.

baeckerman83 started a new conversation Use Component In Other Component

Hi! I've a blade component link with href and a slot Also I've a element component with many divs and there in one div for an tooltip I can set a tooltip.

So I've @component('element', ['tooltip]=>@component('link',['href'=>'laracast.com])@endcomponent] ) @endcomponent

But this is not working. Can I set this component in the array for the element component?

baeckerman83 started a new conversation Same Columns In Two Tables, Query Builder

Hi! I've a sql Query DB::table('table1')->join('table2','table1.id','=','table2.table1_id')->orderByRaw('position')->get();

In both tables, table1 and table2 is a column id. After the request I get a collection with one attribute id, the id attribute ist from table2 Why? How can I change this to id from table1? So I need something like table1.id or?

18 Feb
5 months ago

baeckerman83 left a reply on Three Tables Connected - How To Do With HasMany?

I tried this, but it's not working. I had to use return $this->belongsToMany('App\Right'); instead of App\Right::class.

15 Feb
5 months ago

baeckerman83 started a new conversation Three Tables Connected - How To Do With HasMany?

Hi! Can someone show me how I can handel a database table model where I have three tables.

  1. User with user id (Laravel Table)
  2. Rights with rights id (my own Table)
  3. UserRights Table with rights und user id (my own table)

Because one User can have many rights, also one right can have many users. How can I get the rights name for an User?

28 Jan
5 months ago

baeckerman83 started a new conversation Where In Controller Index

Hi! i'm new to laravel. I found a tutorial in a German Magazine and it looks nice. So I make my first steps. But now I have a question. I think it's a easy one. I take little steps. So first I've created a model and migrations file. It was all fine and the database table is generated. After that I look for the GET Api (index Controller Method). I can get alle countries from my table. So now I want to get a specific Country. But the where is not working. What is wrong with my code? What do you need to help me? So Country::all is working, but Country::where('id',2) not.

public function index()
{
    return CountryResource::collection(
        // $countries = Country::all() 
        $countries = Country::where('id',2)
      );
}

I also tried

public function index(Country $country)
{
    return CountryResource::collection(
        // $countries = Country::all()
        $countries = Country::where('id',$country->id)
      );
}

But this isn't working as well.

The error on the website is :" BadMethodCallException Call to undefined method Illuminate\Database\Eloquent\Builder::mapInto()"