mecjos

mecjos

Member Since 2 Years Ago

İstanbul

Experience Points
2,400
Total
Experience

2,600 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
7
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.

Level 1
2,400 XP
Jan
16
1 month ago
Activity icon

Replied to How To Bind Multiple Selectbox In Table Rows

Thank you... it worked )

Jan
15
1 month ago
Activity icon

Started a new Conversation How To Bind Multiple Selectbox In Table Rows

Hi every one.. I have selectbox in table row. When I select and option in a raw, all select box are changing becasue it is binded to same data. How can I to this properly..

             <tbody>
                    <tr v-for="(job, index) in order.jobs">
                      <td>{{ index + 1 }}</td>
                      <td>{{ job.part.part_no}}</td>
                      <td><img class="avatar-sm" :src="pasteImage(job.part.image)"></td>
                      <td class="text-center">
                        <select v-model="selectedState"  class="form-control" style="width: 100%">
                          <option v-for="state in states" :value="state.id">{{ state.state_lang[0].name }}</option>
                        </select>
                      </td>
                    </tr>
                  </tbody>
Oct
03
4 months ago
Activity icon

Replied to FormData File Append Problem. Big Size Files Doesn'T Append

is there anyone has an answer?

Oct
01
4 months ago
Activity icon

Replied to FormData File Append Problem. Big Size Files Doesn'T Append

not appended to formData. I checked it. it's on frontside.

Activity icon

Started a new Conversation FormData File Append Problem. Big Size Files Doesn'T Append

Hi.. I have a problem with uploading files. I'm trying to send form data as following codes..

let formData = new FormData()
if (this.cad_files.length > 0) {
            console.log(this.cad_files)
            this.cad_files.forEach( function (file) {
              if (!file.id) {
                console.log(file)
                formData.append('cadNames[]', file);
              }
            })
          }

when I select a small size file it's ok but with big size files it doesn't append file to form data. Is there any size limit on formData.append ??

Activity icon

Replied to How To Run Bootstrapvue Toasts Inside Vuex Module

I got the solution... Since it's in vuex's action method. you must send vm instance to actioan method with an argument like following line.

this.$store.dispatch('createJob', {vm : this, payload : payload})

then you can use it inside vuex action method like following

createJob ({commit}, {vm, payload}) {
    axios.post('jobs', payload)
      .then( response => {
        commit('updateJobState', response.data)
        vm.$bvToast.toast('İş başarıyla oluşturuldu.', {
          title : 'OK',
          variant : 'success',
          solid : true,
        })
      }).catch( error => {
        console.log(error.response.data.message)
      vm.$bvToast.toast(error.response.data.message, {
        title : 'Oops! Birşeyler yanlış gitti!!!',
        variant : 'danger',
        solid : true,
       })
    })
  }

Sep
18
5 months ago
Activity icon

Replied to How To Run Bootstrapvue Toasts Inside Vuex Module

I user bootstrapvue globally.. It's obvious that not about importing. even when I try to reach a store state inside catchblock by using this.$store.state....... I can't ... I think it's about scope problem but I'm not enough good at javascript.. :)

Activity icon

Replied to How To Run Bootstrapvue Toasts Inside Vuex Module

Isn't there anybody to help?

Sep
16
5 months ago
Activity icon

Started a new Conversation How To Run Bootstrapvue Toasts Inside Vuex Module

Hi. Actually I try to create simple tost message according to axios response.. my axios post request is in a vuex module.. I try following code but it doesnt't work.. when I print (this.$bvToast) to console, it gives undefined..

createJob ({commit}, payload) {
    axios.post('jobs', payload)
      .then( response => {
        console.log(response)
        // commit('update')
      }).catch( error => {
      console.log(this.$bvToast)
      this.$bvToast.toast('this is a test toas', {
        title : 'Test'
      })
    })
  }

How can I use this toaster in axios catch block?

Sep
10
5 months ago
Activity icon

Replied to How To Write Code In Laracast?

yeah that's a test.. 
Activity icon

Replied to Date.UTC Doesn't Work?

Thanks for the Moment.js advice. I found my problem and I fixed with following method :

timestampToDate (timestamp) {
      let dateArray = timestamp.split(/[- :]/)
      let newSplittedTime = dateArray.map( (index) => {
        return parseInt(index)
      })
      return new Date(Date.UTC(newSplittedTime[0], newSplittedTime[1]-1, newSplittedTime[2], newSplittedTime[3], newSplittedTime[4], newSplittedTime[5]))
    }

First I put dates without converting to integer. Because when you write 09 as integer, actually it's 9.

Activity icon

Started a new Conversation Date.UTC Doesn't Work?

Hi, I'm fighting with javascript date methods. Since I store my dates in mysql timestamp format in db, I have to convert javascript date format into timestamp. I don't have problem with this but when I want to edit any form I have to convert timestamp to js date format back. To do that I use date.utc() method and its format is (YYYY, m, d, h,m,s) according to js documantation. I try it on jsfiddle in following format :

new Date(Date.UTC(2019, 09, 09, 21, 00, 00)) 

it works. But when I do the samething on my local dev server it gives error and webstorm ide suggests the format in form of Date.UTC(2019, 9, 9, 21, 0, 0). What's the difference on local?

Generally How Can I handle time and date issues on vue? Thank you.

Sep
01
5 months ago
Activity icon

Replied to How To Fill Name Column Of Oauth_access_token Table?

Ok, if it's not required or not useful for password grant token, it can stay empty :) As far as I understood that I don't have to use guzzle http to take token , right?

Activity icon

Started a new Conversation How To Fill Name Column Of Oauth_access_token Table?

Hi,

I'm using laravel passport for api authentication and using guzzle http to take access token on the backend side with following request as you know from laravel documentation:

$http = new \GuzzleHttp\Client;
    $response = $http->post(config('services.passport.login_endpoint'), [
        'form_params' => [
            'grant_type' => 'password',
            'client_id' => config('services.passport.client_id'),
            'client_secret' => config('services.passport.client_secret'),
            'username' => $request->username,
            'password' => $request->password,
        ]
    ]);

with this request laravel passport creates a record in oauth_access_token table. I want to fill name column with this request. How can i do it?

Activity icon

Replied to Passing Token Via Axios To Laravel

I fixed the problem.. there must be a space after "Bearer" .. I forgot it.. :( thanks all.

Activity icon

Replied to Passing Token Via Axios To Laravel

I tried it on following line :

axios.defaults.headers.common["Accept"] = "application/json"

when I add authorization token on postman it adds automatically Accept = /. I think that means accept all type of content. when I add application/json it gives status 401

Might be a problem on laravel side??

Activity icon

Started a new Conversation Passing Token Via Axios To Laravel

Hi,

I'm trying to make api request to fetch data and using following code to pass token via axios request..

login ({commit, state, dispatch}, authData) {
  return axios.post('login', {
    username : authData.username,
    password : authData.password,
    returnSecureToken : true
  }, 'head').then(response => {
    commit("setToken", response.data.access_token)
    localStorage.setItem("token", response.data.access_token)
    axios.defaults.headers.common["Authorization"] = "Bearer" + response.data.access_token
    axios.defaults.headers.common["Accept"] = "*/*"
    localStorage.setItem("expirationDate", new Date().getTime() + +response.data.expires_in*1000)
    dispatch("setTimeoutTimer", +response.data.expires_in*1000)
    console.log("login işlemleri yapıldı")
  }).catch(error => {
    console.log(error)
    localStorage.removeItem('token')
  })
},

with this code laravel redirect to login page, it can't pass the auth middleware but when I make same request via postman I can get datas.. What's the problem with my logic?

Activity icon

Replied to Cors Middleware Does Not Work On New Computer

Thanks all. I installed laravel cors and fixed the problem.

Aug
27
5 months ago
Activity icon

Replied to Cors Middleware Does Not Work On New Computer

I tried it and it also doesn't work.. I just copied my project to new computer.. I can't understand why it doesn't work on new system.. it seems like there is no middleware.. I delete middleware it gives same error. Isn't there any other solution for cors error except making a middleware.

Activity icon

Replied to Cors Middleware Does Not Work On New Computer

that's the error I got ;

Access to XMLHttpRequest at 'http://testsite.test/api/login' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Activity icon

Started a new Conversation Cors Middleware Does Not Work On New Computer

Hi. I copied my laravel project to my new computer and I think cors middleware doesn't work anymore. I make request from vue api. My middleware is :

public function handle($request, Closure $next)
    {
        $domains = ['http://localhost:8080', 'http://localhost.8081', 'http://127.0.0.1:8081'];
    if (isset($request->server()['HTTP_ORIGIN'])) {
        $origin = $request->server()['HTTP_ORIGIN'];
        if (in_array($origin, $domains)){
            header('Access-Control-Allow-Origin: ' . $origin);
            header('Access-Control-Allow-Headers: Origin, Content-Type, Authorization');
            header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, PATCH, DELETE');
        }
    }
    return $next($request);
}

What can be the problem on new computer??