YeZawHein

YeZawHein

Member Since 1 Year Ago

Experience Points 53,150
Experience Level 11

1,850 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 466
Lessons
Completed
Best Reply Awards 9
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.

09 Jul
1 week ago

YeZawHein left a reply on Laravel Passport Tables

That' why passport have refresh_tokens.Your access_tokens should be short_lived expiration time because this will make more secure authentication.If your short-live access_token has stolen,the attacker can't accept your account longer.When access_tokens expired, you can regenerate new access_tokens using refresh_tokens.

05 Jul
1 week ago

YeZawHein left a reply on Can't Connect To Algolia .

SCOUT_QUEUE defaut is false in scout.php.Your should change SCOUT_QUEUE = true in .env.

YeZawHein left a reply on Dynamic Arguments Not Working.

v-bind:href="url"
13 Jun
1 month ago

YeZawHein left a reply on Problem With V-model On Message Input & IsTyping Indicator

I believe that one conversation will have many messages.So I suggest that way.Never mind :)

YeZawHein left a reply on Problem With V-model On Message Input & IsTyping Indicator

i think this error will be in v-for

 <li class="media" v-for="(value, index) in conversations.message" :key="index">
  {{value}}
</li>

YeZawHein left a reply on Problem With V-model On Message Input & IsTyping Indicator

@theunforgiven Can you do this?

store(){
            if (this.message.length != 0) {
                this.conversions.message.push(this.message);
                axios.post('/conversations', {
                    message : this.message,
                    conversations:this.conversations
                })
                .then(response => {
                    console.log(response);
                    this.message = ''
                })
                .catch(error => {
                    console.log(error);
                });
            }
        }

YeZawHein left a reply on Problem With V-model On Message Input & IsTyping Indicator

@theunforgiven I don't know the whole structure of your code.But I think your conversations should object in my mind.

YeZawHein left a reply on Conditionally Show Blade View

Another option base on your problem.

@if (\Request::is('*/fields') OR /Request::is('*/fields/*' )
    
@else
  
@endif

11 Jun
1 month ago

YeZawHein left a reply on Return Json Response For Only API 404 Error

@elo >get localhost:8000/books/1 return default laravle 404 not found page >get localhost:8000/api/books/1 return json response

Now I realize your problem. That error should be in web.php.You don't have fallback function for 'web.php.You can create custom404` view.

//api.php
Route::fallback(function () {
    return response()->json(['error' => 'Not Found!'], 404);
});

//web.php
Route::fallback(function () {
    return view('errors.404'); //custom view
});

YeZawHein left a reply on Return Json Response For Only API 404 Error

@elo This error means Handler.php not found fallback function.Try debug in api.php

Route::fallback(function () {
   dd(here);
});
10 Jun
1 month ago

YeZawHein left a reply on Return Json Response For Only API 404 Error

@elo Try this

//handler.php
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

 public function render($request, Exception $exception)
    {
        if ($exception instanceof NotFoundHttpException) {
            return Route::respondWithRoute('fallback');
        }

        if ($exception instanceof ModelNotFoundException) {
            return Route::respondWithRoute('fallback');
        }

        return parent::render($request, $exception);
    }

//api.php
Route::fallback(function () {
    return response()->json(['error' => 'Not Found!'], 404);
});

01 Jun
1 month ago

YeZawHein left a reply on Passport With Cookies And CSRF Protection.

@jlwalker

I realise now that you really can’t. What that means?I give you just an advice.

localStorage uses essentially the same security policy as cookies; one of its core principles is that a domain cannot access localStorage data that was created under a different domain so there is no chance that a website could steal data from a different website. I don't want to dispute with you.If you want cookies prevent from csrf, use SameSite=strict cookie.

31 May
1 month ago

YeZawHein left a reply on Passport With Cookies And CSRF Protection.

Cookies vs local storage

Both of the mechanisms have their own pros and cons.You should concentrate on XSS protection, that’s perfect of the protection. Everything is safe against a remote attacker as long as you use HTTPS and there is no XSS on your page. Your main concern should be avoiding XSS. If you have XSS on your page then basically everything is lost, the attacker will be able to attack the user’s session one way or other, it does not matter if you use cookies, local / session storage or IndexedDB, etc.

29 May
1 month ago

YeZawHein left a reply on "Class 'App\Http\Controllers\FetchPostsfromBlog' Not Found"

You use class FetchPostsFromBlog in controller.But in your view FetchPostsfromBlog?

YeZawHein left a reply on Logic Architecuture For Passport Token Expire Time

Solved!Actually, my code flow is wrong.

 $tokenResult = $user->createToken('Personal Access Token');
  if ($request->remember_me) {
         Passport::personalAccessTokensExpireIn(now()->addHours(3));
       } else {
         Passport::personalAccessTokensExpireIn(now()->addMinutes(15));
       } //I tried to add time after create token and that make didn't work.
----------------------------------------------------------------------------------------------------
   if ($request->remember_me) {
            Passport::personalAccessTokensExpireIn(now()->addHours(3));
        } else {
            Passport::personalAccessTokensExpireIn(now()->addMinutes(15));
        }
        $tokenResult = $user->createToken('Personal Access Token');         
28 May
1 month ago

YeZawHein left a reply on Update With CRUD

Route::resource('shares', 'ShareController');

That is already have 7 routes.Read to Laravel documentation.Check with

php artisan route:list

YeZawHein started a new conversation Logic Architecuture For Passport Token Expire Time

I don't know that much about passport.I need advice for passport token expire time.I searched for it but I still haven't found any appropiate answer. When user click remember_me token lifetime should be long-lived. So,

//AuthServiceProvider.php

 if ($request->remember_me) {
            Passport::personalAccessTokensExpireIn(Carbon::now()->addHours(1));
        } else {
            Passport::personalAccessTokensExpireIn(Carbon::now()->addMinutes(1));
        }

It works but I think that isn't not appropiate solution.I didn't want to set this logic in 'AuthServiceProvider.php'.I want to handle in controller.

//Controller 
if ($request->remember_me) {
        Passport::personalAccessTokensExpireIn(Carbon::now()->addHours(1));//it doesn't work

            $token->expires_at = Carbon::now()->addHours(1);//only work in database value ,it doesn't affect for passport
        }

//AuthServiceProvider
    Passport::personalAccessTokensExpireIn(Carbon::now()->addMinutes(1)); //I want to put this default.

Any your advice will be greatly appreciated.

23 May
1 month ago

YeZawHein left a reply on Laravel Eloquent Filter Product's Attributes

@kakallatt Try this one!

$products = Product::whereHas('attributes', function ($query) {
        $query->where('name', 'RAM')
            ->whereIn('value', ['8GB', '4GB']);
    })->whereHas('attributes', function ($query) {
        $query->where('name', 'HDD')
            ->where('value', '256GB');
    })->get();

YeZawHein left a reply on Which Editor Do You Use To Work?

VS Code is not an IDE like Visual Studio and Phpstrom. It is also not a simple code editor with a few commands and syntax highlighting. It sits somewhere in the middle, making it a simple yet powerful tool thanks to the fact that it supports extensions.

-It’s free and cross-platform (Linux and Apple are also supported). -It’s way smaller than Eclipse, NetBeans, and other big IDEs. -It’s more advanced than Notepad++ and other simple code editors. -It’s well supported by Microsoft and the developer community. -It's support typescript intellisense and Git tools work well. -There are many extensions available for different languages and file formats. -The range of available plugins is growing more quickly than the Jetbrains tools

PhpStorm is an IDE by JetBrains that provides a wide range of cutting-edge features. It is a project-based IDE designed for experienced coders looking to develop professional platforms and large applications.

-The application is built on Java which is a huge advantage to developers. It lets developers use the software on multiple development platforms and carry a conducive development environment with them. -It's powerful but not free. -You may pay for it, but you get better access to support and Jetbrains as a company tries to be very good at serving customer requests -Better code refactorings and more intelligent understanding of code analysis

I will go to VS code but this is just my view.

22 May
1 month ago

YeZawHein left a reply on How To Get All The Namespace Group Route

You mean?

php artisan route:list

YeZawHein left a reply on Dynamic Table

@wultyc Why not work bro?Think as simple.Try this one.

//in controller
    use Illuminate\Support\Facades\Schema;

public function index()
    {
     
    $data = DB::table('table_name')->get();
        $columns = Schema::getColumnListing('table_name');

        return view('yourview.index', compact('columns','data'));
    }
//view
         
            <tr>
                @foreach ($columns as $column)
                <th>{{$column}}</th>
                
                @endforeach
            </tr>
            @foreach ($data as $value)
            <tr>
                    @foreach ($columns as $column)
                        
                    <td>{{$value->$column}}</td>
                    @endforeach
                 
                </tr>
                @endforeach
               
              </table>

That is exactly what you want?

YeZawHein left a reply on Dynamic Table

@wultyc

//controller
use Illuminate\Support\Facades\Schema;

public function index()
    {
     
        $columns = Schema::getColumnListing('table_name');

        return view('yourview.index', compact('columns'));
    }

//view
<table>
    <tr>
            <?php $number = 1; ?>
            @foreach($columns as $column)
    
            <th>{{ $number }} </th>
            <?php $number++; ?>
        @endforeach
    </tr>
    <tr>
            @foreach ($columns as $column)
            <td>{{ $column}}</td>
        @endforeach
    </tr>
</table>

YeZawHein left a reply on Laravel 5.8 Foreign Key Not Working

Not sure.But try this

 $table->unsignedBigInteger('a_id')->index();

YeZawHein left a reply on Multiselect Vue Data Properties And Methods Missing

import Multi from './multi.vue'; 

Vue.component('multi', Multi); 

var app = new Vue({
    mixins: [require('spark')],
});
21 May
1 month ago

YeZawHein left a reply on VSC Blade Snippets Not Recognizing Blade.php

@dan3460 Find your settings.json file in vscode and add this code

"blade.format.enable": true,
 "emmet.includeLanguages": {
        "blade": "html"
  },
    

YeZawHein left a reply on Multiselect Vue Data Properties And Methods Missing

@demoskp You are using vue package but try to solve with .js file? In multiselect.vue

<template>
        <multiselect v-model="value" tag-placeholder="Add this as new tag" placeholder="Search or add a tag" label="name" track-by="code" :options="options" :multiple="true" :taggable="true" @tag="addTag"></multiselect>
</template>
<script>

import Multiselect from 'vue-multiselect'
  
export default {
    components: {
      Multiselect
    },
    data () {
      return {
        value: [
          { name: 'Javascript', code: 'js' }
        ],
        options: [
          { name: 'Vue.js', code: 'vu' },
          { name: 'Javascript', code: 'js' },
          { name: 'Open Source', code: 'os' }
        ]
      }
    },
    methods: {
      addTag (newTag) {
        const tag = {
          name: newTag,
          code: newTag.substring(0, 2) + Math.floor((Math.random() * 10000000))
        }
        this.options.push(tag)
        this.value.push(tag)
      }
    },
    
  }

</script>

In app.js

Vue.component('multi', require('./multi.vue').default); 
//shouldn't same name with multiselect.It will be overwritten package's component and will be error Maximum //call stack size exceeded

var app = new Vue({
    el: '#app',        //BTW you forgot in vue instance
    mixins: [require('spark')],
});

You can call in blade

<multi></multi>

YeZawHein left a reply on Redirection Failure On Captcha

Model needs to implement theIlluminate\Contracts\Auth\Authenticatableinterface

use Illuminate\Contracts\Auth\Authenticatable

class YourClass extends Model implements Authenticatable
{
    
}

YeZawHein left a reply on Page Not Found - Except Route Proplem

Route::post('product/test', '[email protected]');
16 May
2 months ago

YeZawHein left a reply on How To Update A Product In Laravel 5,8

He said when you update, you should know what id in product want to update.

public function update($id , Request $request)
{
   $product = Product::findOrFail($id);
//your codes
}
15 May
2 months ago

YeZawHein left a reply on Data Not Saving In Database Table In Real

@devfrey That is just business requirement.Everything is possible.

YeZawHein left a reply on Data Not Saving In Database Table In Real

Using fillable is good but when if you have more than 15-30 fields in your model?

YeZawHein left a reply on Data Not Saving In Database Table In Real

@engrlaravel If you want to make all attributes assignable, you may define the $guarded property as an empty array.

 protected $table = 'your_table_name';

  protected $guarded = [ ];

YeZawHein left a reply on User Data Isn't Showing Form Db And Not Giving Any Error

@programmer111 You should be use created() method.created is more compatible than methods to fetch data from server.

 created(){
     axios.get('/api/user')
          .then(response => this.users = response.data);
   }
//Same way for ES15
created(){
     axios.get('/api/user')
          .then( ({data}) => this.users = data);
   }
14 May
2 months ago

YeZawHein left a reply on How To Use Contains() On This Collection?

Think as simple . You definitely want with contains()? If you want to collection of onlineUser, try to create in your controller.

@if ($onlineUser->name == $comment->user->name)
    //
@else

YeZawHein left a reply on How To Use Contains() On This Collection?

OnlineUsers will not be one.So

@foreach($onlineUsers as $onlineUser)
@if ($onlineUser->contains($comment->user->name))
    //
@else
//
@endif
@endforeach

YeZawHein left a reply on 精仿国外文凭快速学历551190476微/Q办理加拿大汉森学院高仿毕业证成绩单|制作Henson毕业证成绩单||造假加拿大高仿成绩单学位证|咨询加拿大留学回国认证Henson College

I reached from google translate :grin

Fine imitation foreign diploma fast education 551190476 micro / Q for Canada Hansen College high imitation graduation certificate transcript | production Henson graduation certificate transcript | | fake Canada high imitation transcript certificate | consulting Canada study abroad certification Henson College

YeZawHein left a reply on App.js:40853 [Vue Warn]: Unknown Custom Element: <navbar> - Did You Register The Component Correctly?

That will be your another problem !Check your console and try to solve.Good Luck :)

YeZawHein left a reply on App.js:40853 [Vue Warn]: Unknown Custom Element: <navbar> - Did You Register The Component Correctly?

Same that way! Import and add component.

 components : {
    navbar , 
    customers
}

YeZawHein left a reply on App.js:40853 [Vue Warn]: Unknown Custom Element: <navbar> - Did You Register The Component Correctly?

Because your aren't registered for navbar!

import navbar from "your_path.Vue";


const app = new Vue({
  el: "#app",
  router: router,
 components : {
    navbar
}
});
13 May
2 months ago

YeZawHein left a reply on Passport - Access Token To Json Response With Refresh Token

  return response()->json([         
        "token_type": "Bearer",
            "expires_in": 3155673600,
           "access_token": "eyJ0eXAiOiJKV1QiLCJhb...",
           "refresh_token": "UhQDydBihmhaW..."
        ]);
11 May
2 months ago

YeZawHein left a reply on Passing Object To Blade Vue

This {{ }} expression doesn't need.

  data: {
            options: [ $products->inventory ],
          },
10 May
2 months ago

YeZawHein left a reply on Foreach Blade Return Only One Row - Laravel

@nonanovi When you want to get collection of data means, lots of results then use get() but if you want to retrieve only one result then use first()

$tag = Tag::where('slug', '=', $slug)->get(); 

YeZawHein left a reply on Finding Out If A Table Is Empty

@shiva

if(!$address->isEmpty())
        {
            echo "not empty";
            
        }else{
            echo "empty";
          
        }

YeZawHein left a reply on Method Illuminate\Support\Collection::paginate Does Not Exist

@splendidkeen I think when you use get() ,you already have a collection.Try it

$doctor = Auth::user()->meeting()->latest(); 

09 May
2 months ago

YeZawHein left a reply on Vuejs Components In App.js And In .blades

@fkindy01 That will be fine for you.In your app.js

import Vue from 'vue';

Vue.component('comp', require('./components/comp.vue'));

const router = new VueRouter({
    mode: 'history',
    routes: [
      { path: '/proposals/comp', component: comp }]
  });

const app = new Vue({
    el: '#app',
    router,
});

If you have many components codes will be a little confuse.If you want to more clean, you can create like component.js

import Vue from 'vue';

require('./component.js');

const router = new VueRouter({
    mode: 'history',
    routes: [
      { path: '/proposals/comp', component: comp }]
  });

const app = new Vue({
    el: '#app',
    router,
});

// in component.js
 Vue.component('comp', require('./components/comp.vue'));
 Vue.component('example', require('./components/example.vue'));
//everything you want to add component

YeZawHein left a reply on Vuejs Components In App.js And In .blades

@fkindy01 Vuejs is components based progressive javascript framwork.

If an SPA grows to a significant size, loading the entire all componets on load will be slow. That is one of the disadvantages for SPA. SPA requires average internet speed to execute and load properly in the browser. Slower speed can break design or SPA component during loading time.

If that solved your issue mark reply as the best answer to close the issue.