OlivierJazz

OlivierJazz

Member Since 2 Years Ago

Experience Points 360
Experience Level 1

4,640 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 0
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.

06 Apr
1 year ago

OlivierJazz left a reply on StdClass Could Not Be Converted To Int

Ok... it's simple. Sorry for the inconvenience.

I did not reread my code.

Thnack you

OlivierJazz left a reply on StdClass Could Not Be Converted To Int

$nsscc is an integer.

It is stored in a database and I retrieve it like this:

$nsscc = DB::table('ean128')
                ->select('sscc')
                ->first();

OlivierJazz started a new conversation StdClass Could Not Be Converted To Int

Hello.

I have a problem with a variable concatenation. I do not understand by the return:

Object of class stdClass could not be converted to int

My error is on the second line :

$nsscc = $nsscc++;
$ncsscc = '033755' . $nsscc;
$nom = $ncsscc . '.txt';

Thank you for your help.

30 Mar
1 year ago

OlivierJazz left a reply on Paginate With Where

I found my mistake and it's stupid.

My records in the database were not good. The User_id was incorrect so no result in return...

The function paginate with the "where" works perfectly.

Sorry and thanks for your help ...

29 Mar
1 year ago

OlivierJazz left a reply on Paginate With Where

Don't work to...

I have a customer repository like this :

namespace App\Repositories;

use App\Models\Customer;

class CustomerRepository extends ResourceRepository
{

  public function __construct(Customer $customer)
    {
        $this->model = $customer;
    }
  
}

how call my ressource repository.

OlivierJazz left a reply on Paginate With Where

No.

I use this request in an model.

OlivierJazz started a new conversation Paginate With Where

Hello.

I do not understand why my query does not work. I have the select count (*) but not the search.

  public function getPaginateByUser($n, $id)
  {
    return $this->model
                ->orderBy('last_name', 'ASC')
                ->orderBy('first_name', 'ASC')
                ->where('user_id', 'LIKE', $id)
                ->paginate($n);
  }

Help me please...

10 Mar
1 year ago

OlivierJazz left a reply on Ajax Upload Image HELP

I have solved my probleme but not with ajax.

Thank you

OlivierJazz left a reply on Ajax Upload Image HELP

I made the changes but it still does not work.

OlivierJazz started a new conversation Ajax Upload Image HELP

Hello again. I do not get away with the upload of an image in ajax. I have to forget something in the sending of the data in ajax or in the reception of these in the controller. So my form again :

''' {!! Form::model($user, ['route' => ['user.update', $user->id], 'method' => 'put', 'files' => true]) !!}

@if(session()->has('ok')) {!! session('ok') !!} @endif Informations sur le compte ... {!! Form::file('profilImage', ['class' => 'form-control input-file', 'id' => 'file', 'name' => 'photo_profil']) !!} {!! Form::button(' Valider', ['class' => 'btn btn-success content-botton', 'type' => 'submit']) !!} {!! Form::close() !!} '''

My Ajax : ''' $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('[name="_token"]').val() } });

var file_data = $("#file").prop("files")[0]; var form_data = new FormData(); form_data.append("file", file_data)

$.ajax({ url: '/upload', type: 'POST', data: 'form_data', contentType: false, cache: false, processData:false, }) .done(function(data) { alert("ok"); }) .fail(function(data) { alert("pas bon !!!"); }); '''

My controller : ''' public function uploadImage(Request $request) { if($request->hasFile('profilImage')){

  $path = config('profil.path');

  if($imagegestion->save($request->file('profilImage'), $path)) {
    return true;
  }
}
die;

} '''

and my route : ''' Route::POST('/upload', '[email protected]'); '''

If you have any suggestions. I've been searching for several hours. Help

OlivierJazz left a reply on Ajax Upload Image

Thank you. With a road it works perfectly. I do not see why we should use a road in this case. But thank you very much.

OlivierJazz left a reply on Ajax Upload Image

I have no more information about this bug in the logs of laravel.

OlivierJazz started a new conversation Ajax Upload Image

Hello.

I have a problem on an Ajax request for image upload. I can not get through. I am therefore posting my form to you:

{!! Form::model($user, ['route' => ['user.update', $user->id], 'method' => 'put', 'files' => true]) !!}

@if(session()->has('ok')) {!! session('ok') !!} @endif Informations sur le compte ... {!! Form::file('profilImage', ['class' => 'input-file', 'id' => 'file']) !!} {!! Form::button(' Valider', ['class' => 'btn btn-success content-botton', 'type' => 'submit']) !!} {!! Form::close() !!}

And my javascript :

    var formData = new FormData();// get the form data
        formData = {
            'image_nom'     : ($('input[type=file]')[0].files[0]).name,
            'image_size'    : ($('input[type=file]')[0].files[0]).size,
            'image_type'    : ($('input[type=file]')[0].files[0]).type
        };

        $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('[name="_token"]').val()
                }
        });



    $.ajax({
        url: '[email protected]',
        type: 'PUT',
        data:  'formData',
        contentType: false,
        cache: false,
        processData:false,
    })
    .done(function(data) {
        alert("cest bon !");
    })
    .fail(function(data) {
        alert("pas bon !!!");
    });

And my controller :

public function uploadImage() { return true; }

Under chrome the debug tool returns an error 500 (Internal Server Error). I can not find a solution.

Thanks in advance for your feedback

28 Feb
1 year ago

OlivierJazz left a reply on Access Denied

You're sure the Root user has a password? By default it does not.

Also, see if the user has all the rights on your table.

OlivierJazz left a reply on Ajax Keyup

Thank you. Thanks to the debug, I found mno error. I did not have the correct jquery file including Ajax.

It works now. Thank you.

How do we add a wait before starting the function. Thank you in advance.

OlivierJazz started a new conversation Ajax Keyup

Hello.

I want to set up a simple ajax request but I can not debug my code.

So I have my view :

@section('content')

Référence de l'article {!! Form::text('reference', null, ['class' => 'form-control', 'id' => 'reference']) !!} {!! $errors->first('reference', ':message') !!} @endsection

@section('footer') {{ Html::script('js/ean13.js') }} @endsection

My javascript :

$(function(){

$('#reference').on('keyup', function(e) {
    e.preventDefault();

    $.ajax({
      url: 'searchajax',
    })
    .done(function(){
        alert("oui");
    })
    .fail(function(){
        alert("non");
    });

});

})

My controller :