mballaag

mballaag

Member Since 1 Year Ago

Douala

Experience Points 5,320
Experience Level 2

4,680 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 30
Lessons
Completed
Best Reply Awards 3
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.

05 Nov
8 months ago

mballaag left a reply on Date Time Value Is Not Showing

if you use Mysql the DATETIME - format is YYYY-MM-DD HH:MI:SS. You need to format it on your view or in your controller, before using it in bootstrap. You can use for it Carbon API in your view like that: {{Carbon::createFromFormat('m/d/Y h:i a', $meetings->endDate)}}

10 Sep
10 months ago

mballaag left a reply on Group Sorting Problem

@SunCoding First of all can you put your code in the ``` so everyone can actually read this: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

20 Aug
11 months ago

mballaag left a reply on How To Validate Count Of Array Objects In Request Class?

you can use

''' 'categories' => 'required|array|between:1;3',

'''

19 Aug
11 months ago

mballaag left a reply on No Message On AJAX POST Request

it's means that post routes "/items/user/buying" exit, but the method define on the controller doesn't exit. look well to solve your error

18 Aug
11 months ago

mballaag left a reply on How To Get The Info From The Array To Store In The Answers Table?

i will correct it like that :

if(isset($request['answer'][$key][$nameKey] )){
foreach ($request['answer'][$key][$nameKey] as $answerKey=> $answer) {
$answer = Answer::create([
            'question_id' => $answerKey,
            'participant_id' => $participant_result->id,
            'answer' => $answer,
        ]);
}
}

mballaag left a reply on How To Get The Info From The Array To Store In The Answers Table?

'"$request['answer'][$key]"' and '"$request['answer'][$key][$nameKey]"' return and array is the problem, try foreach for example ''' foreach ($request['answer'][$key][$nameKey] as $answerKey=> $answer) { $answer = Answer::create([ 'question_id' => $answerKey, 'participant_id' => $participant_result->id, 'answer' => $answer, ]); } '''

02 Aug
11 months ago

mballaag left a reply on Where Are You All From?

Douala, Cameroon

22 Jun
1 year ago

mballaag left a reply on Has Not Working In Relationship Query

if you replace has('dsedatalast') by whereNotNull('dsedatalast')

mballaag left a reply on How To Organize This Context? Two Tables/models Or Just One?

For Registration model is:

public function proforma()
{
    return $this->hasMany('App\Proforma');
}

the rest is good.

18 Jun
1 year ago

mballaag left a reply on How To Update Approved From 0 To 1 In Laravel

you take and id in enter on your route. you have to first find the submitApplication you want to update

$submitApplication = SubmitApplication::find($id);
$submitApplication->approved = 1;
$submitApplication->save();

but on form url you send requisition id, not submitApplication's id. you have to modify that.

17 Jun
1 year ago

mballaag left a reply on Get Id On Slect Box

@chagouani je ne sais pas si c'est normal que vous n'ayez plus d'erreur puisque c'est la même collection. mais c'est normal qu'il affiche tous les metiers puisque c'est ce que vous demander dans le controller. en créant $metiers notamment. je vois dans le code des références au cache essaye de rentrer sur mon ancien code et tu clear le cache avec la commande. ''' php artisan cache:clear ''' et vous relancez l'operation

15 Jun
1 year ago

mballaag left a reply on Get Id On Slect Box

@chagouani cet erreur ne concerne pas le create.blade. celle que vous envoyee est dejà résolu actuelement.

je voudrais la liste d'erreur. vous pouvez par exemple faire un test de la plateforme et me montrez ce qu'il y a dans les fichiers de log d'aujourd'hui le 15/06/2018

mballaag left a reply on Users Table

yes your method is safe. you don't have to add table for your case.

14 Jun
1 year ago

mballaag left a reply on Get Id On Slect Box

@chagouani $metier est correctement envoyé sur la vue. je voudrais plus d'informations sur l'erreur pour pouvoir la debug. pouvez vous capturer et afficher l'erreur la plus récente dans les log le chemin du fichier est certainement votre_fichier\storage\logs\laravel-2018-06-14.log

mballaag left a reply on Get Id On Slect Box

metier possède t'il bien les attributs 'id' et 'libelle_metier'?? si oui ajoute dans ton controller avant le return

var_dump( $metiers); die;

vous capturez et envoyer le résultat afin que je puisse le consulter.

mballaag left a reply on Get Id On Slect Box

@chagouani ton model devrait être alors :

metier.php

public function techniciens()
{
    return $this- 
    >belongsToMany('App\technicien','technicien_metier','metier_id','technicien_id');

}

technicien.php

public function metier()
{
    return $this- 
>belongsToMany('App\metier','technicien_metier','technicien_id','metier_id');

}

dans le premier vous avez rempli la table comme etant 'technicien_zone'

mballaag left a reply on Get Id On Slect Box

tu dois donc avoir un problème avec la déclaration de ton modèle.

si 'technicien-zone' c'est ta table intermediaire entre 'techniciens' et 'metiers' il doit contenir les colonnes 'technicien_id' et metier_id comme tu les a déclaré. or technicien_zone ne contient pas de colonne 'metier_id'

mballaag left a reply on Get Id On Slect Box

c'est mon code qui produit cet erreur ?? je ne parle nulle part d'une table "technicien_zone"

mballaag left a reply on Get Id On Slect Box

désolé pour le retard @chagouani :

public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->whereHas('techniciens', function($query) use ($technicien_id){
        $query->where('id',$technicien_id);
    })
    ->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

mballaag left a reply on Get Id On Slect Box

@chagouani try this:

public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('techniciens', function($query) use ($technicien_id){
        $query->where('id',$technicien_id);
    })
    ->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

mballaag left a reply on Filtering Multiple Relationships

@cunlayogd First of all can you put your code in the ``` so everyone can actually read this: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

mballaag left a reply on Get Id On Slect Box

@chagouani ok:

public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('techniciens', function($query, $technicien_id){
        $query->where('id',$technicien_id);
    })
    ->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

petite correction pour la vue sinon tu vas te retrouver avec des strings dans le controller

@foreach($metiers as $metier)
      <option value={{$metier->id}}>{{$metier->libelle_metier}}</option>
@endforeach
                                

mballaag left a reply on Get Id On Slect Box

ok si c'est une relation manytomany le coontroller doit changer

public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('technicien', function($query, $technicien_id){$query->where('id',$technicien_id;})->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

mballaag left a reply on Get Id On Slect Box

@chagouani votre table "metiers" n'est pas lié à des techniciens ou bien la colonne qui doit contenir l'id du technicien ne s'appelle pas technicien_id. vous pourrez corriger le code du controller facilement. la partie concernée par les metiers est la suivante:

    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('technicien_id',$technicien_id)->get();
   

il faudrait changer technicien_id par la bonne colonne ou suprimer toute la clause where('technicien_id',$technicien_id)

mballaag left a reply on Hi All,please Convert The Give Raw Query To Laravel EOLQUENT

First of all can you put your code in the ``` so everyone can actually read this: https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code

but try this:

$students=DB::table('students as s')
      ->left('student_enrollment_units_new as se', 's.id', '=', 'se.student_id','left outer')
     ->select(' s.id',DB::raw('count(se.id) as month,(select count(id) from student_enrollment_units_new where student_id=s.id and date between CURDATE() - INTERVAL 7 DAY AND CURDATE() and status="enrolled") as week'))
      ->whereBetween('se.date', [Carbon::now(), Carbon::now()->subDays(30)])
      ->where('se.status',"enrolled")
      ->where('s.active',1)
    ->whereNull('s.deleted_at')
    ->groupBy('s.id')->get();

Don't forget to use

use Carbon\Carbon;
13 Jun
1 year ago

mballaag left a reply on Converting MySQL Query To Eloquent

@Nicholas this look like this

$first = DB::table('queue_log')->max('date_time')->groupBy('callid')->get()->toArray();

$query = DB::table('queue_log')
            ->whereIn('date_time', $first)
            ->where('event','CALLBACK')
            ->get();

mballaag left a reply on Get Id On Slect Box

@chagouani une fois que le technicien est choisi automatique depuis le backend et n'est plus rechoisi sur l'interface de tarfircation, l'on peut directement envoyer ces metiers sur l'interface et les faire afficher.

donc le controller serait ca :

 public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('technicien_id',$technicien_id)->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

et la modification dans la vue :

<div class="form-group">
        <div class="col-md-12">
                <div class="col-md-4">
        <label>Metier: </label>
        <select onchange="getTachesByMetier(this.value)" style="width: 
200px" class="productm form-control" id="metiers">
            <option value="">-Select-</option>
        @foreach($metiers as $metier)
            <option value="{{$metier->id}}">{{$metier->libelle_metier}}</option>
        @endforeach
       </select>
                </div>

là vous avez les métiers du technicien sélectionné sur la page précédente. et à chaque changement de metier tu récupères juste les postes par ajax comme vous le faites déjà.

mballaag left a reply on Get Id On Slect Box

une fois que le technicien est choisi automatique depuis le backend et n'est plus rechoisi sur l'interface de tarfircation, l'on peut directement envoyer ces metiers sur l'interface et les faire afficher.

donc le controller serait ca :

 public function create($technicien_id)   
{
    $technicien = technicien::find($technicien_id);
    $taches = Tache::orderBy('libelle_tache', 'asc')->get();
    $metiers = Metier::orderBy('libelle_metier', 'asc')->where('technicien_id',$technicien_id)->get();
    return view('tarification.create')->with('technicien', $technicien)->with('metiers', 
   $metiers);
}

et la modification dans la vue :

<div class="form-group">
        <div class="col-md-12">
                <div class="col-md-4">
        <label>Metier: </label>
        <select onchange="getTachesByMetier(this.value)" style="width: 
200px" class="productm form-control" id="metiers">
            <option value="">-Select-</option>
        @foreach($metiers as $metier)
            <option value="{{$metier->id}}">{{$metier->libelle_metier}}</option>
        @endforeach
       </select>
                </div>

mballaag left a reply on Sql Query Not Working With DB::select

@hassanraza504 i update the code above. please retry.

mballaag left a reply on Get Id On Slect Box

vous pouvez expliquer le problème en francais (on se comprendra mieux je pense :) )

mballaag left a reply on Sql Query Not Working With DB::select

i rewrite the code for you :


$first = DB::table('dealers')
            ->select('id' ,'fname', 'last_order_date' , 'created_at', 'masterdealers as Source', 'null as type') 
                         ->select(DB::raw('(select id as uuid from uuids WHERE userable_type LIKE '____m%' AND userable_id = masterdealers.id) as uuid'))

$second = DB::table('customers')
            ->select('id' ,'fname','last_order_date' , 'created_at', 'dealers as Source' , 'null as type')
            ->select(DB::raw('(select id as uuid from uuids WHERE userable_type LIKE '____m%' AND userable_id = masterdealers.id) as uuid'))


$results = DB::table('masterdealers')
            ->select('id' ,'fname' , 'last_order_date' , 'created_at', 'masterdealers as Source', 'null as type')
            ->select(DB::raw('(select id as uuid from uuids WHERE userable_type LIKE '____m%' AND userable_id = masterdealers.id) as uuid'))
            ->where('created_at','>=',$startDate)
            ->where('created_at','<=', $endDate)
            ->unionAll($first)
                        ->unionAll($second)
            ->get();

mballaag left a reply on Convert Simple Mysql Query Into Eloquent Query With Relation Ship

try this for the first query:

OrderStatusDetail::whereIn('id', function($query){
             $query->max('id')
               -> groupBy('order_detail_id');   
            })->where('order_id',210)->get()->toArray();
12 Jun
1 year ago

mballaag left a reply on Get Id On Slect Box

what is the content of function's controller whose return create.blade.php??

mballaag left a reply on Get Id On Slect Box

i suppose you controller will be like

public function create($technicien_id)   
    {
        $technicien = technicien::find($technicien_id);
        $taches = Tache::orderBy('libelle_tache', 'asc')->get();
        $metiers = Metier::orderBy('libelle_metier', 'asc')->get();
        >with('technicien', $technicien)->with('metiers', $metiers);
    }

on your controller i replace this:

<div class="form-group">
        <label for="technicien">Technicien</label>
           <select onchange="getMetiersByTechnicien(this.value)" 
name="technicien_id" id="technicien_id" class="form-control">
                   <option value="">-Select-</option>
                   @foreach($technicien as $t)
                          <option value="{{$t->id }}" {{ $t->id == 
$technicien_id ? 'selected = "selected"' : '' }}>
                                {{$t->user->nom}}
                          </option>
                   @endforeach
            </select>
    </div>

by this:

<div class="form-group">
        <label for="technicien">Technicien : {{$technicien->user->nom}}</label>
          < input name="technicien_id" type="hidden" id="entry_ref" value="{{ $technicien->id}}" >
    </div>

mballaag left a reply on Get Id On Slect Box

@chagouani

on view you replace your select by input.

for session you add session on your controller function

you can retrieve value like this on any controller :

Session::get('technicien_id');

mballaag left a reply on Get Id On Slect Box

you can use hidden input

<input name="technicien_id" type="hidden" id="entry_ref" value="{{ $technicien_id}}" >

or session

session(['technicien_id' => $technicien_id]);

mballaag left a reply on Laravel Auth Login Index Password Issue

which error is display ???

mballaag left a reply on HTTP Response Code For TokenMismatchException In Ajax Requests

on your code. can you have this ;

<script>
$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});
</script>

and this

<meta name="csrf-token" content="{{ csrf_token() }}">
11 Jun
1 year ago

mballaag left a reply on Language Switcher Not Working

in your route command you send $id but in your controller's function you have enter $lang and not $id. the error can come for that

you must have this :

public function changeLanguage($id) {

mballaag left a reply on How I Make Search Student Records I Did't Know How To Make It Guide Me For This

you have this model :

class student extends Model
{
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'students';

    /**
    * The database primary key value.
    *
    * @var string
    */
    protected $primaryKey = 'id';

    /**
     * Attributes that should be mass-assignable.
     *
     * @var array
     */
    protected $fillable = ['name','surname'];
}

you have this form on view:

<form method="GET" action="{{ url('/student') }}" accept-charset="UTF-8" class="navbar-form navbar-right" role="search">
                            <div class="input-group">
                                <input type="text" class="form-control" name="search" placeholder="Search..." value="{{ request('search') }}">
                                <span class="input-group-btn">
                                    <button class="btn btn-default" type="submit">
                                        <i class="fa fa-search"></i>
                                    </button>
                                </span>
                            </div>
                        </form>

you have this controller:

class studentController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\View\View
     */
    public function index(Request $request)
    {
        $keyword = $request->get('search');
        $perPage = 25;

        if (!empty($keyword)) {
            $student =student::where('name', 'LIKE', "%$keyword%")
                ->orWhere('surname', 'LIKE', "%$keyword%")
                ->paginate($perPage);
        } else {
            $student = student::paginate($perPage);
        }

        return view('home.searchStudent', compact('student'));
    }
}

and you have a simple resource route to student

Route::resource('student');

mballaag left a reply on How To Do Laravel Search?

@themezoon please can you mark it as solve.

mballaag left a reply on Laravel Query Builder Error Column Not Found With Joins And Parameter Grouping

is it "trial" or "trail" on your users column??.

if its correct, can we see your migration or database schema ??

mballaag left a reply on Https://laracasts.com/discuss/conversations/create

you can create a channel for that

mballaag left a reply on Call To Undefined Method Maatwebsite\Excel\Excel::load()

make sure config/Excel.php file exist. Be sure you declare on your controller

use Excel;

and not

use Maatwebsite\Excel\Excel;

mballaag left a reply on Property [id] Does Not Exist On This Collection Instance.

just try this on your view

@foreach($avgStar as $rating)
    @foreach($inventories as $inventory)
        @if($inventory->id == $rating->inv_id) 
                {{$avgStar->rating}}
            @endif 
    @endforeach
@endforeach 
10 Jun
1 year ago

mballaag left a reply on How To Do Laravel Search?

can you correcty explain your ideas ? if it"s search on database you have this model : ''' class book extends Model { /** * The database table used by the model. * * @var string */ protected $table = 'books';

/**
* The database primary key value.
*
* @var string
*/
protected $primaryKey = 'id';

/**
 * Attributes that should be mass-assignable.
 *
 * @var array
 */
protected $fillable = ['numero'];

} ''' you have this form on view: '''

''' you have this controller: ''' class bookController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index(Request $request) { $keyword = $request->get('search'); $perPage = 25;
    if (!empty($keyword)) {
        $book = book::where('numero', 'LIKE', "%$keyword%")
            ->orWhere('lieu', 'LIKE', "%$keyword%")
            ->paginate($perPage);
    } else {
        $book = book::paginate($perPage);
    }

    return view('book.index', compact('book'));
}

} '''

07 Jun
1 year ago

mballaag left a reply on Laravel 5.5 & Bootstrap 4 Pagination Issues

@HFH @MustafaAgamey use ''' {{ $users->links() }} ''' Remember, the HTML generated by the links method is compatible with the Bootstrap CSS framework

06 Jun
1 year ago

mballaag left a reply on Translate Site Based On Country Selected In A Select Menu

nothing more, everything for internationalisation is available

mballaag left a reply on One Controller For Different Roles And Query

@clusteCode you can easily made 'if' options with blade.