Baptiste

Baptiste

Member Since 2 Years Ago

Experience Points
1,180
Total
Experience

3,820 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.

Level 1
1,180 XP
Apr
08
2 years ago
Activity icon

Started a new conversation How To Retrieve A Value In A Route From A Controller

Hello to you,

I have a view or I list my games and I have a button that allows me To access the forum according to the games :

   a style="float:left" class="btn btn-danger" href="{{route('sujet.index'$jeu->id)}}">Forum</a>

I need to recover the value at the end of my url so 1 in this context in order to be able to reference the forum according to the game but since my controller how can I do?

Http:// localhost/multigaming/public/subject?1

Here is the subject index:

    public function index() {  
   
    $lesSujets = Sujet::paginate(20);    
    return view('sujet/index', compact('lesSujets'));
     
    } 

 

Mar
25
2 years ago
Activity icon

Started a new conversation Package Chatter

Hello to you,

I have to create a forum for a site I game and I would install the package chatter. Just before ca, I would like to have opinions, who advice me ?

Thank you in advance for your advice.

Mar
06
2 years ago
Activity icon

Started a new conversation How To Communicate A Database In MySQL With A Database In Windev

Hello to you,

I create a site in Laravel 5.3 with for database management system MySQL 5.7.11 and I have to retrieve attributes from the database of the computer park. But this database is under Windev.

How can I make to interact these two basic?

Feb
24
2 years ago
Activity icon

Replied to How To Include Animate Css In Sweetalert2

Hello,

I just want to be able to modify my overlay method ? No one has a solution ?

Feb
23
2 years ago
Activity icon

Started a new conversation How To Include Animate Css In Sweetalert2

Hello,

I can display my alerts but I would like to be able to configure them. I managed to trigger an alert when I clicked a button but in my case what I would like is to use animate css with an overlay () alert. It shows up well what I would like is just to make it move according to the options.

Here is what I do :

HomeController

(In the controller I just show the alert because the rest is not used it is just the creation of a graph and I return well the value to the view no worries of that side.) :

public function index()
{

if ($sommePoidsC >= 400){  
        Alert()->overlay('Warning !', 'The amount is exceeded'! ','warning');
    }

}

flash.php :

class Flash 

{

public function create($title, $message, $type, $key = 'flash_message')
    {
    return session()->flash($key, [
        'title'     => $title,
        'message'   => $message,
        'type'      => $type
    ]);
    }

public function overlay($title, $message, $type = 'warning')    
    {
    return $this->create($title, $message, $type, 'flash_message_overlay');
    }

}

flash.blade.php (That I created) :

{

@if (session()->has('flash_message_overlay'))
<script type="text/javascript">
swal({  
    title: "session('flash_message_overlay.title')",   
    text: "session('flash_message_overlay.message')",   
    type: "session('flash_message_overlay.type')",   
    confirmButtonText: 'Ok',
    animation: 'false',
    customClass: 'animated tada'
 });
</script>
@endif 


}

And in my view home I do @include ('flash').

Ah yes I forgot to specify that I used laravel 5.3 and that for alerts I use the packet infinety / alerts.

I am inspired by this discussion : https://laracasts.com/discuss/channels/laravel/confirm-delete-using-sweetalert?page=1

Could you help me please ?

Feb
15
2 years ago
Activity icon

Started a new conversation Button Confirmation SweetAlert2 Delete

Hello, my confirmation button does not work. I can show the confirmation and it appears correctly by doing no action but when I click "Yes delete" nothing happens. I do not know much about ajax and jquery so i will need help please thanks in advance.

Routes : web.php

Route::delete('peri/truncate','[email protected]')->name('peri.truncatePeri');

index.blade.php

{ {{ Form::open(['route' => ['peri.truncatePeri'], 'method' => 'delete', 'class'=>'delete_form']) }} Normally here there is a button with the value id = "PeriTruncate {{ Form::close() }}

}

JS { $('#periTruncate').on('click', function(e){ e.preventDefault();

    swal({
        title             : "Are you sure?",
        text              : "You will not be able to recover this Album!",
        type              : "warning",
        showCancelButton  : true,
        confirmButtonColor: "#DD6B55",
        confirmButtonText : "Yes, delete it!",
        cancelButtonText  : "No, Cancel delete!",
        closeOnConfirm    : false,
        closeOnCancel     : false
    },
     function(isConfirm){
      if (isConfirm) {
      $.ajax({
       method: 'delete',
       url: that.attr('action'),
      })
     .done(function() {
   
     .fail(function() {

    }); 
    
   }  
});  

});

Controller

{ public function truncatePeri(Request $request) {

    $site_id = auth()->user()->site_id; 
    $peri = DB::table('peris')->where('site_id', $site_id)->delete();  
    alert()->success('Bien joué !', 'La remise à zéro a été effectuée avec succès');
    return redirect(route('peri.indexPeri'));
    
}

}

Normally I just want to redirect to my truncatePeri function when I click ok and I have to return it no value according to me seen that all this do at controller level no ?

Feb
12
2 years ago
Activity icon

Replied to Confirmation White SweetAlert

I resumed the line with the button I indicated in the link but it does not appear otherwise it should be between the level of the first form between form :: open and form :: close please excuse me for the Disturbance.

Activity icon

Started a new conversation Confirmation White SweetAlert

Hello, Here is my view, when I carry out the deletion it works but I will like to change the form and use sweetAlert. I have all installed but it seems more complicated to carry out the confirmation voila what I do :

{ @include('flash')

            <thead>
                <tr>
                    <th>Numéro de série</th>
                    <th>Nom gemini</th>
                    <th>Constructeur</th>
                    <th>Modele</th>
                    <th>Poids</th>
                    <th>action</th>
                    
                </tr>
            </thead>
            <tbody>
                @foreach ($materielNS as $materielAtt)
                <tr>
                    <td>{{ $materielAtt->numSerie}}</td> 
                    <td>{{ $materielAtt->nomGemini}}</td> 
                    <td>{{ $materielAtt->constructeur}}</td> 
                    <td>{{ $materielAtt->modele}}</td>
                    <td>{{ $materielAtt->poids }} kg</td> 
                    <td>
                        {{ Form::open(['route' => ['materiel.destroyMateriel', $materielAtt->id],

'method' => 'delete']) }} Delete {{Form::close() }} @endforeach

                    </tbody>
                    <script>
                    $(document).on('click', '.button', function (e) {
e.preventDefault();
var id = $(this).data('id');
swal({
        title: "Are you sure!",
        type: "error",
        confirmButtonClass: "btn-danger",
        confirmButtonText: "Yes!",
        showCancelButton: true,
    },
    function() {
        $.ajax({
            type: "POST",
            url: "{{url('/destroy')}}",
            data: {id:id},
            success: function (data) {
                         
                }         
        });
});

});

        <a class="btn btn-info" href="{{route('materiel.createMateriel', $materiel)}}">Créer</a>
        

}

Here is what I base myself on: http://stackoverflow.com/questions/40579520/delete-method-with-sweet-alert-in-laravel. But it does not even show me the alert..

I need help please any help would be appreciated..

Feb
09
2 years ago
Activity icon

Replied to SweetAlert White Laravel 5.3

Thank you very much and it works well on Laravel 5.3 ?

Activity icon

Started a new conversation Change The Color Of A Pie With Chart.js

Hello,

is it possible to change the color of a pie with chart.js ? Apparently is possible but quite complicated according to the documentation.

Has anyone succeeded ?

Part : Chart Examples : Pie https://erik.cat/projects/Charts/docs/4

Feb
08
2 years ago
Activity icon

Started a new conversation SweetAlert White Laravel 5.3

Hello

I try to use sweetAlert but the installation I can not display one. Is it still in service ?

https://github.com/uxweb/sweet-alert

When I am in the use part of the documentation nothing appears.

The steps I do :

1 - composer require uxweb/sweet-alert

2-'providers' => [ UxWeb\SweetAlert\SweetAlertServiceProvider::class ];

3-'aliases' => [ 'Alert' => UxWeb\SweetAlert\SweetAlert::class ];

4- use Alert; (In HomeController)

5- Alert::message('Robots are working!'); return view home...

I think I'm hurting the installation while I'm doing what I'm told but maybe I'm wrong can you help me please ?

Feb
07
2 years ago
Activity icon

Started a new conversation Change The Color Of A Pie With Charts

Hello,

In the documentation of charts to paragraph of tart apparently one can not change the colors of the table finally if but it to the air complicated according to the documentation. Would someone have succeeded ?

Title : Chart Examples - Pie

url : https://erik.cat/projects/Charts/docs/4

Activity icon

Started a new conversation Create A Mail Form With Mailto

Hello, I have some difficulty to create a form in a table with mailto voila what I have done but with blade I have some difficulty in order to realized my message. Any help would be appreciated please

Here is what I have but it is in html and it is not terrible :

{

FORM ACTION="mailto:[email protected]" METHOD=GET INPUT NAME=subject TYPE=hidden VALUE="Informations déchets " TEXTAREA NAME=body style="display:none;" COLS=40  Bonjour Patrice, Le numéro de série est {{$materielAtt->numSerie}} Le nom Gemini est {{$materielAtt->nomGemini}} Le constructeur est {{$materielAtt->constructeur}} Le modèle est {{$materielAtt->modele}} Le poids est de {{$materielAtt->poids}}kg

cordialement,

xxxxxxx TEXTAREA INPUT TYPE=submit VALUE="Envoi mail Gemini" FORM

}

This is what I tried but I barely realized my message because it returns me a text error...

{

{{ Form::open(['method' => 'GET', 'url'=>'mailto:[email protected]']) }} {{Form::hidden('objet', 'Informations déchets') }} {{Form::textaera('corps', 'Bonjour Patrice' 'Le numéro de série est'{!!$materielAtt->numSerie!!} 'Le nom Gemini est'{!! $materielAtt->nomGemini!!} 'Le constructeur est'{!!$materielAtt->constructeur!!} 'Le modèle est' {!!$materielAtt->modele!!} 'Le poids est' {!!$materielAtt->poids!!}'kg'

'cordialement'

'xxxxxxx', ['size' => '30x5']) }}) {{Form::input('submit','Envoi')}} {{Form::close() }} @stop

}

Feb
06
2 years ago
Activity icon

Replied to Sends Mail When I Create New Hardware

I use mailtrap

Activity icon

Replied to Sends Mail When I Create New Hardware

I should receive an email on mailtrap no ?

Activity icon

Started a new conversation Sends Mail When I Create New Hardware

Hello, I develop a site that can handle computer waste and when I put in my table a new waste this must go prevent the computer park I thought so do with events. And here is what I do concretely.

Here is my event

{

namespace App\Events;

use Illuminate\Broadcasting\Channel; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class sendMail

use InteractsWithSockets, SerializesModels;
public $id;

 Create a new event instance.

 @return void
 
public function __construct($id)
{
    $this->id = $id;
}


  Get the channels the event should broadcast on.

  @return Channel|array
 
public function broadcastOn()
{
    return new PrivateChannel('channel-name');
}

}

Part of the listener :

{

namespace App\Listeners;

use App\Events\sendMail; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Contracts\Queue\ShouldQueue; use App\Materiels; use Illuminate\Support\Facades\Mail;

class sendMailFired {

 * Create the event listener.
 *
 * @return void
 */
public function __construct()
{
    
}

/**
 * Handle the event.
 *
 * @param  sendMail  $event
 * @return void
 */
public function handle(sendMail $event)
{
    
    
    $materielAtt = Materiel::find($event->id)->toArray();

      Mail::send('send', $materielAtt, function($message) use ($materialAtt) {
        $message->to($materielAtt['email']);
        $message->subject('Event Testing');
    });
}

}

}

And my other party in the controller to save waste :

{ public function storeMateriel(Request $request) {

    $materielAtt ['numSerie']  = $request->input('numSerie'); 
    $materielAtt ['nomGemini'] = $request->input('nomGemini');
    $materielAtt ['constructeur'] = $request->input('constructeur');  
    $materielAtt ['modele'] = $request->input('modele'); 
    $materielAtt ['poids'] = $request->input('poids');  
    $materielAtt ['site_id'] = $request->input('site_id'); 
    DB::table('materiels')->insert($materielAtt);
    Event::fire(new SendMail($materielAtt));
    return redirect(route('materiel.indexMateriel'))->with('success','Le déchet à bien été créer');
}

}

How can I test its operation?

Activity icon

Replied to How To Create Graphic And Diagrams

Yes I have already tried with charts but it returns me this error :

Unknown chart library / type combination (With a sign above that contains an exclamation point.)

I followed the same instructions as in the video :

Https://www.youtube.com/watch?v=KrAvrU2XYuY

I looked at the documentation and I tried with all versions yet it always returns me the same error..

Activity icon

Replied to How To Create Graphic And Diagrams

At first I tried to install chart js but the installation did not work. I'm looking for the same kind of design and what I'm trying to do more accurately is a pie chart.

Thank you for your answers.

Feb
05
2 years ago
Activity icon

Started a new conversation How To Create Graphic And Diagrams

How to create graphic diagrams and any other representation of this kind please?

Feb
04
2 years ago
Activity icon

Started a new conversation Problem With Charts

Hello, I try to install charts in my project on laravel 5.3 but when I finish all installed and set up the different configurations voila what I receive:

Unknown chart library / type combination (With a sign above that contains an exclamation point.)

I followed the same instructions as in the video:

Https://www.youtube.com/watch?v=KrAvrU2XYuY

And yet I adapted well according to the version for example for setValues ​​now gives values ​​when I declare my chart in home controller. In addition I have access to my class charts because instead of using use Chars I put use ConsoleTVs \ Charts \ Facades \ Charts; Would you have any ideas to solve this problem please ?

Feb
03
2 years ago
Activity icon

Replied to Display Problem With Values

It is almost that except that I want to insert this column in a table and the result at the level of the display shows me:

["ABDJCF45", "IODLFLFOEL45", "IDKLDPLDPD45"]

In the first row of my column

Feb
02
2 years ago
Activity icon

Started a new conversation Display Problem With Values

Hello I want to display the values ​​according to the foreign key of the user. It almost works with this instruction :

{ $materiel->where('site_id', auth()->user()->site_id)->value('numSerie') }

But in my debugbar when I see the result I see this:

Select numSerie frommateriels where site_id = '6' limit 1

How do I get rid of limit 1? Because otherwise it would work..Or perhaps there is another way of

doing?

Jan
31
2 years ago
Activity icon

Started a new conversation How To Create 3 Different Sites Using Foreign Key

Hello everyone, I realized a site with different tables such as:

  • website
  • user
  • equipment
  • peripheral

This site is currently available only for one city or I was asked to create this site for three different cities. Recreating 3 times the same tables does not help me so I will reference my site in each table using a foreign key. But after how can I make to display the desired website according to the foreign key ?

At the level of my code I have nothing to offer you for now because I do not see how to do.

Jan
28
2 years ago
Activity icon

Replied to Field With Two Values

Yes that's it normally. In fact my internship tutor wants to retrieve certain attributes from another database by name or number. For that it wants a field that would allow him to return either the number for all to recover or the name. We would therefore have a field with two values ​​normally not. Is this possible already ?

Activity icon

Started a new conversation Field With Two Values

Hello I want to create a field where I can indicate two values ​​such as serial number and age. For example if I indicate the age only ca validate without problem and if I will indicate the serial number only ca would validate too. Simply a field that would allow me to validate either one without any problem. Is it possible ?

Jan
27
2 years ago
Activity icon

Replied to Field That Retrieves The Value

Thank you for your help

Activity icon

Replied to Field That Retrieves The Value

With disabled I can not retrieve the value. Does there exist a syntax that would recover a value without being able to modify it? Because I would like to retrieve my value in a field without being able to modify it and then insert it in a table.

Activity icon

Started a new conversation Field That Retrieves The Value

Hello :) Can I make a field non-editable while Recovering value?

Jan
26
2 years ago
Activity icon

Started a new conversation How To Display The Attribute Of A Collection In A Label Field

hello,

To retrieve a value from a field contained in another table I do this :

{

$periCons = DB::table('gemini.peri_bs')->select('constructeur')->where('numSerie', $numSerie->numSerie)->get(); }

And in my form to display the attribut i do :

{

{!! Form::label('constructeur', 'constructeur') !!} {!! Form::label('constructeur', $periCons->pluck('constructeur') , ['class' => 'form-control']) !!}

}

But in the display of my field ca gives :

["SNCF"]

Can I only retrieve the attribute without the array ?

Jan
25
2 years ago
Activity icon

Replied to Check If An Attribute Is Not Already In A Collection

It doesn't work with has() or contains()..

I have done different tests but my equality is still not taken into account while theoretically this should .. Could you help me please ?

Jan
24
2 years ago
Activity icon

Started a new conversation Check If An Attribute Is Not Already In A Collection

Hello, I would like that when I enter a serial number that ca recovers me the different attributes of another database. I have two database on which I work and dechetinfo and the other of which I wish to retrieve the attributes is called gemini.

My plan is to retrieve the serial number that I send at the field level and compare it to the gemini table collection which also contains a serial number list. And if the tie and check then I return false. (False and just to serve as a test) My problem and test the equality in fact I can not do it ..

{ public function storePeri(Request $request)

    $periB = new PeriB(); 
    
    $periB->numSerie=$request->get('numSerie');
    $periG = DB::table('gemini.peri_bs')->get(['numSerie']); 

    $periG->each(function ($periG, $key)  use($periG,$periB) {
        if ($periB == $periG) {
            return false;
        }
        else
        {
        echo $periG.", ";
        
        }
    });
   
    return redirect(route('besancon.peri.indexPeri'))->with('success','Le déchet à bien été créer');
}
Jan
23
2 years ago
Activity icon

Replied to How To Retrieve Information About Other Database

Yes thank you very much, only I'm not sure about understanding everything ..

Activity icon

Started a new conversation How To Retrieve Information About Other Database

Hello,

i have two base on mysql one that calls waste and another geminii, how can I retrieve the information from the geminii table to the waste table in the view ?

Concretely I have to fill a field in my view and then it must be able to complete the form using the information to retrieve in the gemini database.

Could you help me please?

Jan
22
2 years ago
Activity icon

Started a new conversation Insert Multiple Values ​​in An Array With Integer Drop-down Lists

Hello, I am currently working on a site that needs to be able to manage computerized waste. I have divided the waste into different parts such as peripherals and other. In the other part I want to insert a keyboard, a mouse and other elements several times using an integer drop-down list from 1 to 10. For example i will check keyboard, its weight and indicate the number of times I want to see it fit into the table. I do it very well to record it once but I can not find solutions to record it several times according to the indicated number. Do you have any ideas please ?

Here is the code for the add form

{ @extends('admin/layout') @section('content')

Ajouter un nouveau déchet

{!! Form::open(['url' => route('besancon.autre.storeAutre')]) !!}

{!! Form::label('Clavier') !!}{!! Form::checkbox('nomGemini', 'clavier', false) !!} {!! Form::label('Poids') !!}{!! Form::checkbox('poids', 2, false) !!} {!! Form::label('nombre','Nombre') !!}{!! Form::select('number', [1,2,3,4,5,6,7,8,9,10], ['class' => 'form-control']) !!}

Ajouter plusieurs déchets

{!! Form::close() !!}

@stop }