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-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.

06 Apr
2 years 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
2 years 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
2 years 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;
    }
  
}

who call my ressource repository.

OlivierJazz left a reply on Paginate With Where

No.

I use this request in an model. If I remove the where condition that's work. But I need it...

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
2 years 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]) !!}
<div class="row content">
  @if(session()->has('ok'))
    <div class="col-lg-12">
      <div class="alert alert-success alert-dismissible">{!! session('ok') !!}</div>
    </div>
  @endif
  <div class="col-lg-10">
    <div class="panel panel-primary">
      <div class="panel-heading">Informations sur le compte
      </div>
      <div class="panel-body">
        <div class="row">
          <div class="col-sm-2 col-sm-12">
            <img src="../img/unknown.jpg" alt="..." class="img-thumbnail" id="result">
            <div class="input-file-container">
              {!! Form::file('profilImage', ['class' => 'form-control input-file', 'id' => 'file', 'name' => 'photo_profil']) !!}
              <!-- <input class="input-filegfd" id="file" type="file"> -->
              <label for="file" class="input-file-trigger" tabindex="0"><span class="ion-edit" aria-hidden="true"></span></label>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-lg-2">
    <div class="row">
      <div class="col-lg-12 col-md-6 col-sm-6">
        {!! Form::button('<span class="ion-checkmark" aria-hidden="true"></span> Valider', ['class' => 'btn btn-success content-botton', 'type' => 'submit']) !!}
      </div>
  </div>
</div>
</div>
{!! 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:

@section('content')
{!! Form::model($user, ['route' => ['user.update', $user->id], 'method' => 'put', 'files' => true]) !!}
<div class="row content">
  @if(session()->has('ok'))
    <div class="col-lg-12">
      <div class="alert alert-success alert-dismissible">{!! session('ok') !!}</div>
    </div>
  @endif
  <div class="col-lg-10">
    <div class="panel panel-primary">
      <div class="panel-heading">Informations sur le compte
      </div>
      <div class="panel-body">
        <div class="row">
          <div class="col-sm-2 col-sm-12">
            <img src="../img/unknown.jpg" alt="..." class="img-thumbnail" id="result">
            <div class="input-file-container">
              {!! Form::file('profilImage', ['class' => 'input-file', 'id' => 'file']) !!}
              <!-- <input class="input-filegfd" id="file" type="file"> -->
              <label for="file" class="input-file-trigger" tabindex="0"><span class="ion-edit" aria-hidden="true"></span></label>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-lg-2">
    <div class="row">
      <div class="col-lg-12 col-md-6 col-sm-6">
        {!! Form::button('<span class="ion-checkmark" aria-hidden="true"></span> Valider', ['class' => 'btn btn-success content-botton', 'type' => 'submit']) !!}
      </div>
  </div>
</div>
</div>
{!! Form::close() !!}
@endsection

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
2 years 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 :

<label for="reference" class="col-md-4 control-label">Référence de l'article</label>

      <div class="col-md-6">

            {!! Form::text('reference', null, ['class' => 'form-control', 'id' => 'reference']) !!}

            {!! $errors->first('reference', '<small class="help-block">:message</small>') !!}

       </div>

 </div>

My javascript :

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

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

});

My controller :

public function __construct()
{
  $this->middleware('auth');
  $this->middleware('ajax', ['only' => 'search']);
}

public function index()
{
  return view('ean13.index');
}

public function search()
{
    echo "yes";
    die();
}

And my routes :

Route::get('/ean13', '[email protected]');

Route::get('/ean13/search', array('as'=>'searchajax','uses'=>'[email protected]'));

I do not understand what's wrong? Normally when I type a letter in my reference field, I should have a message with Yes.

Thank you for your help.