mecjos

mecjos

Member Since 1 Year Ago

─░stanbul

Experience Points 1,660
Experience Level 1

3,340 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 6
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

15 Mar
1 week ago

mecjos left a reply on GuzzleHttp Hang Up My Laravel App

@STEVECOVE - Hi. I have same problem.. I use php artisan serve and guzzlehttp doesnt response... it just waits then exceeds response time.. I use easyphp apache server.. How can I serve my app on it?

mecjos left a reply on Accessing Token Based API Route Via Vue/Axios

I couldn't understand what you wanted to do with that config but you can use something like following

axios.get('/api/user/school',)
    .then(response => () {
        localStorage.setItem("token", response.data.token)
    })

After store the token in localstorage, you can use it to route.

mecjos left a reply on Public Storage

if you will use public_path(), it must contain storage/ .. for example, your public path is storage/app/public/images/..... you can use public_path(storage/images/image.png)

mecjos left a reply on GuzzleHttp Doesn't Response

And after send request by guzzle, I can't take any response from server.. It ruins all responses..

mecjos started a new conversation GuzzleHttp Doesn't Response

Hi everyone. For two days, I have been tyring to take oauth token by makin guzzlehttp request. But guzzle request doesn't response. It waits for response then exceeds execution time. I installed guzzlehttp, enabled allow_url_fopen and curl in php.ini file. What can be the problem with guzzel. I'm trying to take token by using postman and here is my controller

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use GuzzleHttp;

class AuthController extends Controller {
        public function login (Request $request) {
            $http = new GuzzleHttp\Client;
            $response = $http->request('post', 'http://127.0.0.1:8000/oauth/token', [
                'form_params' => [
                'grant_type' => 'password',
                'client_id' => 2,
            'client_secret' => 'XAjhpNmcpcAA7DnboSQp7GEiE0vFk4E4qPGt5eDr',
            'username' => $request->username,
            'password' => $request->password,
            'scope' => '',
        ],
    ]);
    return json_decode((string) $response->getBody(), true);
}

}

mecjos left a reply on Laravel GuzzleHttp Get Methode Is Taking Too Long To Respond

If you can share how did you fix, I'll be glad. I have same problem. Thanks

14 Mar
1 week ago

mecjos left a reply on Laravel GuzzleHttp Post Methods Is Not Responding .it Is Continuesly Loading

@NIKUNJ001 - I have same problem. I'm trying to get oauth token by sending post request with postman. There is no response just waiting... I tired your solution but at this time, I got following error ;

Symfony\Component\Debug\Exception\FatalErrorException: main(): Failed opening required '../../../vendor/autoload.php' (include_path='.;C:\php\pear') in file C:\Users\Mecjos\webdev\laravel\worcloud\app\Http\Controllers\AuthController.php on line 4 Stack trace:

How did you fix the problem? thank you

11 Mar
2 weeks ago

mecjos left a reply on How To Retreive Appended Form Object From Request?

@CRONIX - and at this time I got following respone

["[object Object],[object Object],[object Object]"]

I think it's about appending the object into formData object. Becuase when I send same data object in axios like following way axios.post('url', {data : [{'id':1.....},{'id':2.......}]) it works.

mecjos left a reply on How To Retreive Appended Form Object From Request?

@JLRDW - I tried that you said as follow ;

public function store (Request $request) {
    $arrayObject = $request->operations;
    return Response::json($arrayObject);
}

and server error message is Response::json does not exist.. this Response class is Illuminate\Http\Response

mecjos started a new conversation How To Retreive Appended Form Object From Request?

Hi. I want to send an object array to store via axios post request in vue. I append following object array to formData,

[
    {'id':1, 'name':'foo', 'operation_id':1}
    {'id':2, 'name':'foo2', 'operation_id':2}
]

and append this data to formData object

formData.append('operations', this.selectedOperations)

I couldn't get this data with laravel request when I get it it returns string. How can I get these data.

21 Feb
1 month ago

mecjos left a reply on How To Get A Calling Function In Vuex?

isn't there any answer?

20 Feb
1 month ago

mecjos left a reply on Npm Install Maximum Call Stack Size Exceeded ??

Isn't there any deep solution for this problem??

mecjos started a new conversation How To Get A Calling Function In Vuex?

Hi. I would like to get the calling function of a mutation? I want to call same mutation function ( updateProjects ) from an action function to delete projects from projects store and to add new projects. Because of that I need to know which action function is calling the mutation. How Can i do that?

state : { projects : [] }

mutations:

updateProjects () { if (calllingFunction == delete) { do delete ops.. } elseif (callingFunction == update) { do update ops... }

actions : { deleteProject ({commit}, payload) { commit("updateProjects", payload) } addProject ({commit}, payload) { commit("updateProjects", payload) } }

something like that.

19 Feb
1 month ago
18 Feb
1 month ago

mecjos left a reply on How To Show Images In Vue Component?

@BOBBYBOUWMANN - I saw it. didn't work. ) I think I need web-pack and configure it. But i don't know how to do.)

mecjos started a new conversation How To Show Images In Vue Component?

I have installed Vue cli 3 without webpack. I'm trying to show an image by binding sr.

<img class="avatar-lg" :src="imageSrc" />

that's data :

data () {
    return {
        imageSrc : "../../assets/no_image.png"
    }
}

when I put the path directly into src attribute without binding, I can see image but when I bind same path, I can't. I have been trying to handle this for hours :)) that will make me sick. What's the reason?

mecjos started a new conversation How Can I Access Root State From A Module?

I want to update a state in store.js from a module. How can i do that?

store.js

state : {
    tableData : [],
}

project.js /*** module js faile ***/

const mutations = { updateProjectList(state, project) { state.tableData.push(project); } }

Thank you

mecjos started a new conversation What Is The Difference Between API Resource And Eloquent Collections

I am new on using Laravel api things. I'm trying to understand what's the differece between api resources and eloquent native collection results. It's not clear yet for me. I'm using postman to analyze data but I can't see huge diffrenece. As far as I see api resources just wrap with data tag all datas.. :) Most probably it's not like that. If someone guide me about the differences and advantages, I'll be so glad. Thank you.

16 Feb
1 month ago

mecjos left a reply on Npm Install Maximum Call Stack Size Exceeded ??

@BOBBYBOUWMANN - I tried to install dependencies one by one.. it seems like laravel mix cause this problem. Do you have any idea?

mecjos left a reply on Npm Install Maximum Call Stack Size Exceeded ??

@BOBBYBOUWMANN - didn't work.. I have just installed laravel app why it gives that error??

mecjos left a reply on Npm Install Maximum Call Stack Size Exceeded ??

@BOBBYBOUWMANN - Ok. how can I cleand the cache? I tried to node_modules directory inside the npm directory.. it failed completely..

mecjos started a new conversation Npm Install Maximum Call Stack Size Exceeded ??

I installed fresh laravel 5.7. and tried to npm install.. it gives following error log

3264 verbose stack RangeError: Maximum call stack size exceeded 3264 verbose stack at RegExp.test () 3264 verbose stack at isDepOptional (C:\ProgramFiles\nodejs\node_modules\npm\lib\install\deps.js:398:27) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:414:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3264 verbose stack at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9) 3265 verbose cwd C:\Users\Mecjos\deneme\worcloud 3266 verbose Windows_NT 10.0.17134 3267 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" 3268 verbose node v10.15.1 3269 verbose npm v6.4.1 3270 error Maximum call stack size exceeded 3271 verbose exit [ 1, true ]

what is maximum stack size exceeded error. Just yesterday I installed same laravel version and installed npm.??

mecjos left a reply on How To Remove Vue's Default Div Element

@TYKUS - I use ready to use bootstrap template from envatomarket. Actually it's a jquery template but I want to use only css side and transfrom it into vue. Because of that template's structure, when vue wrap all site with this div, its appearance spoils.

mecjos started a new conversation How To Remove Vue's Default Div Element

Hi. I have a problem about the vue's constant div element. Vue build all application in the div elemen which has id="app" or etc. This wraps all content in a div element and this causes problem for my template. How can I unwrap my content out of this div element? Thank you.

14 Feb
1 month ago

mecjos left a reply on Is It Possible To Upload Files With Undefined Mime Type?

I fixed the problem. If you try to store file using store or put method, laravel tries to determine mime type automatically and it can't. To store them properly, you should use storeAs or putFileAs method by given the original name of file.

mecjos started a new conversation Is It Possible To Upload Files With Undefined Mime Type?

Hi everyone. I'm trying to upload some type of files in CAD formats like step, stp, drw, etc.. Becouse these types are not defined in mime types, I get a mime type error from server. When I enable php fileinfo extension, laravel store these type of files as text file. How Can I fix this problem? Thank you all.

13 Feb
1 month ago

mecjos left a reply on How Can Be Validated Any File Type In Laravel ?

Besides I want to validate multiple file input.

mecjos left a reply on How Can Be Validated Any File Type In Laravel ?

@BRAUNSON - There aren't the file extensinons like "step", "stp", "x_t", "sldprt".. which I want to validate in mime list.. I mean I need to custom file extension validate.

mecjos started a new conversation How Can Be Validated Any File Type In Laravel ?

Hi. I'm trying to use laravel validation for file inputs in "step, drw, x_t etc. formats. How can make a rule for these file types?

Thank you.

mecjos left a reply on Get Files In Base64 Code

@NIKOS - I updated my code into

filesToUpload = [];

$.each(event.target.files, function(index, file){

        filesToUpload.push(file);

}

then I append this fileToUpload Array into form data :

if (filesToUpload) {

            formDatas.append('cadNames', filesToUpload);

}

When I get that cadNames with $request in controller :

if ($request->get("cadNames")) {

        return $request->get('cadNames');

    }

I get following response :

["[object File],[object File]"] 0: "[object File],[object File]" length: 1 proto: Array(0)

11 Feb
1 month ago

mecjos started a new conversation Using Vue Routes With Laravel Routes

Hi everyone. I searched about this topic on discussion but I couldn't find satisfied answers. I want to use my vue.js frontend app on my existed laravel project. There is some complicated situations about routes for me. Do I need to use api resoureces and laravel passport to get data from laravel models etc... Could someone lighten me about relations among api routes, vue routes and laravel passport? Thank you..

10 Feb
1 month ago

mecjos left a reply on How Can I Use ES6 Syntax In Laravel?

briefly I want to use es6 syntax without decleration error.

mecjos left a reply on How Can I Use ES6 Syntax In Laravel?

Ok. then why when I write

import VueRouter from 'vue-router' in app.js .. phpstorm gives me that error "import declerations are not supported by current javascript version" ???

mecjos left a reply on How Can I Use ES6 Syntax In Laravel?

I know that. when I write vue.js codes I use es6 syntax but javascript version in laravel doesn't correct es6.

mecjos started a new conversation How Can I Use ES6 Syntax In Laravel?

Hi. I want to use vue on my project and want to do this by using es6 syntax. I don't want to see error message when i use es6 syntax. Thank you.

10 Jan
2 months ago

mecjos left a reply on Get Files In Base64 Code

@nikos I can det with $request->get('cadNames') or input('cadNames')..

if ($request->get("cadNames")) {

        $cadFiles = $request->input('cadNames');

        echo gettype($cadFiles);

    } else {

        echo "cadNames yok";
    }

cadNames is an array and it has filesToUpload array which contains json data object in following form filesToUpload.push({ "id" : index, "fileType" : fileExtension, "fileData" : fileReader.result.split(',')[1] });

I can't get id, fileExtension and file data props at laravel side. That's my problem

mecjos left a reply on Get Files In Base64 Code

thanks for the link nikos. I have problem with getin the array. I add filesToUpload array into form with following code.

if (filesToUpload) {

            formDatas.append('cadNames[]', filesToUpload);

        }

I can't get the content of cadNames[] array wit following backend code.

if ($request->get("cadNames")) {

        $cadFiles = $request->get('cadNames');

        foreach ($cadFiles as $index => $object) {

            echo $index . json_decode($object);
        }

    } else {

        echo "cadNames null";
    }

mecjos started a new conversation Get Files In Base64 Code

Hi. I want to send any type of file via filereader from javascript to laravel backend. I use following code at javascript side.

var fileReader = new FileReader();

        fileReader.onload = ( function () {

            filesToUpload.push({ id : index, fileData : fileReader.result });

        });

        fileReader.readAsDataURL(value);

I can send data in base64 format but I don't know how can I save this data at laravel side. Could someone give an example. Thank you.

04 Oct
5 months ago

mecjos left a reply on Passing Data From Eloquent To Javascript (Best Practices?)

I use following form to pass a collection. its form is a jSon data but in javascript I see it as a string. How can I pass it as jSON format.

15 Jul
8 months ago

mecjos started a new conversation Getting Trying To Get Property Of Non-object Error From An Object

Hi, I have a product model which has polimorphic relation with image table and I want to append a thumb image into this model collection. My code is below;

public function logo() {

    return $this->morphOne("App\Media", "imageable");

}

public function getThumbImageAttribute() {

    $thumbLogo = $this->logo()->first()->image_name;

    return $thumbLogo;

}

when I run the page, the line includes first()->image_name gives the error "trying to get property of non-object". Below you can see the result of $this->logo()->first() query.

[{"id":1,"parent_user":1,"user_id":2,"name":"Createchnic","address":"Teknopark \u0130stanbul","ref_number":"M\u00dc\u015e-1","email":"[email protected]","phone":"2161112233","active":1,"created_at":"2018-07-15 16:13:36","updated_at":"2018-07-15 16:13:36","thumb_image":{"id":1,"image_name":"no_image.png","imageable_id":"1","imageable_type":"App\Customer","created_at":null,"updated_at":null}},{"id":2,"parent_user":1,"user_id":3,"name":"Fake Engineering","address":"Teknopark \u0130stanbul","ref_number":"M\u00dc\u015e-2","email":"[email protected]","phone":"2161112244","active":1,"created_at":"2018-07-15 16:13:36","updated_at":"2018-07-15 16:13:36","thumb_image":null}]

09 Jan
1 year ago
06 Jan
1 year ago

mecjos started a new conversation Gettin Data From Several Models

Hi. I am new on Laravel and confused a bit. I have simple db relationship but I couldn't make it with ORM. I have three tables - users, customers, customers_detail and images. customers table has one to one relation with customers_detail and customers_detail table has one to many polymorphic relation with images table. I want to get customer detail table and image from customer model. How can I do this? I can't reach customer_detail model's method from inside cutomer model.. I hope I could explain ) thank you..