petritr

petritr

Member Since 2 Months Ago

Experience Points 10,990
Experience
Level
Lessons Completed 18
Lessons
Completed
Best Reply Awards 5
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.

09 Nov
5 days ago

petritr left a reply on Side Up And Down With Vue

@aurawindsurfing

I need slide up and slide down similar to this:

$('.down').animate({scrollTop: '-=250px'}, 800);

petritr started a new conversation Side Up And Down With Vue

I have an easy question. How can i side up or down with vue for 100px or so ?

Side up or down should work separately activate on click

06 Nov
1 week ago

petritr left a reply on Auto Incremented Number Like: 0001

i see, thanks @Borisu, any other ideas ?

petritr started a new conversation Auto Incremented Number Like: 0001

How can set up an auto incremented number like this: 0001 Can i do it in the migration or any ideas ?

05 Nov
1 week ago

petritr left a reply on Unknown Database Type Enum Requested

Row db quer worked for me, thanks for the reply though.

petritr left a reply on How To Pass Enum Values In Select Option

yup that's what i did:

        $type = DB::select( DB::raw("SHOW COLUMNS from hubs  WHERE Field = 'region_id' ") )[0]->Type;
...

this worked for me

petritr started a new conversation How To Pass Enom Values In Select Option

I need the enom values in select option in front end then save them, witch is the best way to do this ?

enim i the database like:

enum('EU', 'US')    

petritr left a reply on Unknown Database Type Enum Requested

@D9705996 witch is the best way to get the enum values from database ? I need to show the enum values in select option in the create method. Any ideas best practices ?

petritr left a reply on Unknown Database Type Enum Requested

@D9705996 got it word at the end i don't know that chaining enum was not supported. Just deleted the column from db then run migration.

petritr started a new conversation Unknown Database Type Enum Requested

I just rename an database table to enum then run the migration again and i got this error

   Doctrine\DBAL\DBALException  : Unknown database type enum requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.

  at /var/www/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php:479
    475|
    476|         $dbType = strtolower($dbType);
    477|
    478|         if (!isset($this->doctrineTypeMapping[$dbType])) {
  > 479|             throw new \Doctrine\DBAL\DBALException("Unknown database type ".$dbType." requested, " . get_class($this) . " may not support it.");
    480|         }
    481|
    482|         return $this->doctrineTypeMapping[$dbType];
    483|     }

  Exception trace:

The migration looks like:

            $table->renameColumn('address','region_id')->change();
            $table->enum('region_id', ['EU', 'USA']);

What im doing wrong now ?

31 Oct
2 weeks ago

petritr left a reply on Problem Updating Foreign Key Column

I have checked that the id exists, what else can cause this ?

petritr started a new conversation Problem Updating Foreign Key Column

When i try to update my foreign key column: save() i got QLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

What's causing this ?

30 Oct
2 weeks ago

petritr left a reply on SQLSTATE[23000]: Integrity Constraint Violation: 1452 Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails

@Sergiu17 i would my problem, the problem was that i had old data in the database where i wanted to change the foreign key. Since i deleted the data my migration went smooth! Finally!!!

petritr left a reply on SQLSTATE[23000]: Integrity Constraint Violation: 1452 Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails

@Sergiu17 i have an hubs table of course! This worked before i changed the primary key and few other things then i got this error.

petritr started a new conversation SQLSTATE[23000]: Integrity Constraint Violation: 1452 Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails

I can't get over this error, what im doing wrong any suggestions ?

                ->references('id')->on('hubs')
                ->onDelete('cascade');
29 Oct
2 weeks ago

petritr started a new conversation How To Display Child Component Outside Parent Component

I have an parent and child component, witch works fine. My question is how to use the child component outside the parent.

<template>
    <div class="row justify-content-center align-items-center">

        <div class="col-md-8 text-left" v-if="selected" v-for="device in devices">
                <p>Device Name: {{ device.name }}</p>
            </div>
        </div>

        <related-list :selected="selected"></related-list>

    </div>
</template>

<script>

    export default {

        data() {
            return {
                devices: [],
                selected: null,
            }
        },
        created() {
            axios.get('/api/devices').then(({ data }) => {
                //console.log(data)
                this.devices= data;
            });
        },
        methods: {
            action(item) {
                this.selected = item;
            },
        },

        mounted() {
            console.log('Component mounted.')
        }
    }
</script>

I have the child component: <related-list :selected="selected"></related-list> How can i use the child component with the data outside the parent component ?

26 Oct
2 weeks ago

petritr left a reply on Laravel 5 From Scratch Series - Windows Version

@anagnam since you are beginner you can install easy wamp(http://www.wampserver.com/en/) or xampp (https://www.apachefriends.org/index.html) with next -> next installation process and just jump the videos that are for setting up local development Environment.

Later you can try and install Homestead or whatever, for now just stick with one of those for setting up local dev env, and jump directly to laravel.

Have fun.

24 Oct
3 weeks ago

petritr left a reply on How To Pass Data Between 2 Components

@lostdreamer_nl thanks, no i don't have parent child components.

petritr started a new conversation How To Pass Data Between 2 Components

How can i pass data from one component to another, i need to pass the data to an component that is not child or parent. I have seen an example with Global Event Bus any suggestions/ideas/examples ?

23 Oct
3 weeks ago

petritr left a reply on Unable To Deploy To Server

When you try to push you get again the error above from you question ? Please, commit your changes or stash them before you can merge. Aborting

petritr left a reply on Unable To Deploy To Server

When you push you will see the same error right ? git push origin ....

petritr left a reply on Unable To Deploy To Server

What happens when you add them git add . ?

petritr left a reply on Unable To Deploy To Server

Have you run before npm ? Can you run it again npm run watch then check git status ?

petritr left a reply on Unable To Deploy To Server

Do you have other branches except master ? Did you change something in other branches ?

petritr left a reply on Unable To Deploy To Server

What do you see when you do git status ?

petritr left a reply on Unable To Deploy To Server

@HJORTUR17 you need to commit your changes before you push, looks like you have some changes that are not commuted.

11 Oct
1 month ago

petritr left a reply on Pull-right Does Not Work In Show.blade.php

@dio7 there is a better way to do this, using pull-right or pull-left worked okay in bootstrap v3, in v4 pull is changed with float.

https://getbootstrap.com/docs/4.0/migration/#utilities

Below @dio7 you can find an link how to do this with bootstrap 4

https://getbootstrap.com/docs/4.0/layout/grid/#horizontal-alignment

10 Oct
1 month ago

petritr left a reply on Making An Application Private

@rpm192 you are welcomed.

petritr left a reply on Making An Application Private

@RPM192 in the routs Route::resource('something','SomethingController')->middleware('auth');

petritr left a reply on Custom Menu

@davy_yg something like this, you need to tag first the class clicked then the sliding element class.

$('.nav-item').click(function() {

    $('.nav-item-inner').slideToggle();
});

petritr left a reply on Li.open

I think i answered your question. :)

petritr left a reply on Li.open

@davy_yg There is an open class when some li is open:

<li class="has-sub open"><a style="text-shadow: rgba(0, 0, 0, 0.35) 0px 1px 1px;"><span style="border-color: rgba(0, 0, 0, 0.35);"><i class="fa fa-fw fa-bars"></i> Menus</span><span class="holder" style="border-color: rgba(0, 0, 0, 0.35);"></span></a>
        <ul style="display: block;">
           <li class="has-sub"><a href="#"><span>Menu 1</span></a>
              <ul style="">
                 <li><a href="#"><span>Menu 1.1</span></a></li>
                 <li><a href="#"><span>Menu 1.2</span></a></li>
              </ul>
           </li>
           <li><a href="#"><span>Menu 2</span></a></li>
        </ul>
     </li>

Here it is check first line: <li class="has-sub open">

petritr left a reply on Li.open

Should be just an normal class name .open

<ul>
    <li class="open"><a></<></li>
</ul>

petritr left a reply on I Got This Error While Sending Mail

@Ramazan probably you need to include App\User in you controller.

use App\User;

09 Oct
1 month ago

petritr left a reply on Return Data From Database With Vue

@simangae you are welcome you can give the correct answer to the one you think, i woud be happy with like comment too. :)

petritr left a reply on Return Data From Database With Vue

@D9705996 yes correct! A bit better.

petritr left a reply on Return Data From Database With Vue

@simangae try <td v-if="user.profile.bio !== null>{{ user.profile.bio}}</td>

petritr left a reply on Return Data From Database With Vue

@simangae try <td v-if="user.profile.bio !== null>{{ user.profile.bio}}</td>

petritr left a reply on Return Data From Database With Vue

@simangae do you see bio there with content or only as null ?

petritr left a reply on Return Data From Database With Vue

@simangae what happens if you just {{ user.profile }} do you see any data in front end ? If so past them.

petritr left a reply on Return Data From Database With Vue

@cuwa okay i "believe".

petritr left a reply on Return Data From Database With Vue

@simangae when you un-comment and save do you see the error in the front end or in the editor? Can you please save and check? Should work.

petritr left a reply on Return Data From Database With Vue

@cuwa p***y, comment from your real profile!

petritr left a reply on Return Data From Database With Vue

@cuwa you just created an account to comment on my comments WTF? @D9705996 you are right i agree.

petritr left a reply on Return Data From Database With Vue

@D9705996 ha :) Yes your example will work too, mein is a bit cleaner again :)

petritr left a reply on Return Data From Database With Vue

@simangae try this:

<template>
    <div class="table-responsive">

        <table class="table dashboard">
            <tr v-for="user in users">
                <td>{{ user.name }}</td>
                <td>{{ user.profile.bio }}</td>
            </tr>
        </table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                users: [],
            }
        },
        methods: {

            read() {
                axios.get('/api/users').then(({ data }) => {
                    //console.log(data)
                    this.users= data;

                })
                    .catch((err) => console.error(err));
            },
        },
        mounted() {
            this.read();
        }
    }
</script>

petritr left a reply on Return Data From Database With Vue

@simangae can you past here all the vue component code here ? This must work, maybe you have another error too.

petritr left a reply on Return Data From Database With Vue

@simangae what error can you paste it?