Mawunyo

Mawunyo

Member Since 2 Months Ago

Experience Points
1,030
Total
Experience

3,970 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
2
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,030 XP
Nov
21
1 day ago
Activity icon

Started a new Conversation Restore Files Vue Component After Php Artisan Preset None

Please, I did php artisan preset none by error and all my vue component are deleted.

Can I restore them?

Please I need your help.

Nov
20
2 days ago
Activity icon

Awarded Best Reply on Missing Nexmo Configuration Section.", Exception: "RuntimeException

@ismaile @fylzero

Thanks for your answers.

The error was due to a cache problem. I deleted the config caches and it works well

Activity icon

Replied to Missing Nexmo Configuration Section.", Exception: "RuntimeException

@ismaile @fylzero

Thanks for your answers.

The error was due to a cache problem. I deleted the config caches and it works well

Nov
19
3 days ago
Activity icon

Replied to Missing Nexmo Configuration Section.", Exception: "RuntimeException

@ismaile yes I found it. I did publish vendor to put nexmo.php in config folder

Activity icon

Replied to Missing Nexmo Configuration Section.", Exception: "RuntimeException

Yes @ismaile I upadated services.php file like that

Activity icon

Started a new Conversation Missing Nexmo Configuration Section.", Exception: "RuntimeException

Hi, Am trying to send sms with nexmo but am getting this error : Missing nexmo configuration section.

In my .ENV file I put NEXMO_KEY=my_nexmo_key AND NEXMO_SECRET=my_nexmo_secret.

There is my code :

public function toNexmo($notifiable)
{
    return (new NexmoMessage)
                ->content($this->notifDocAppointment['sms_content']);
}

And in my controller :

        $appointment =  Appointment::create([
            'patient_id' => $request['patient_id'],
            'doctor_id' => $request['doctor_id'],
            'start' => $request['start'],
            'end' => $appointment_end,
            'title' => $title,
            'class'=> $class,
            'content'=> $content,
            'notes' => $request['notes'],
            'clinic_id' => auth('clinic')->user()->id,
        ]); 

        $notifDocAppointment = [
            'sms_content' => 'La clinique <b>'.auth('clinic')->user()->name.'</b> vous a programmé un rendez-vous avec le patient <b>'.$patient->firstname.' '.$patient->lastname.'</b> le <b>'.$appointDate.'</b> à <b>'.$appointTime.'</b> . <br><br>Nous vous prions de bien vouloir <b>valider</b> le rendez-vous ou <b>l\'annuler</b> en cas d\'indisponibilité . <br/> En savoir plus : '.url('/').' <br/> Cordialement.',
        ];

        Doctor::findOrFail($doctor_id)->notify(new NotifDocAppointment($notifDocAppointment));
    
    return  $appointment;

Please How can I fixed that?

Nov
14
1 week ago
Activity icon

Started a new Conversation Get Data Id In V-model Autocomplet

Hi,

Please I need your help

I want to make autocomplete input form and get data id in v-model.

Actually I have it in select option .

Nov
11
1 week ago
Activity icon

Started a new Conversation Vujes Form Check If Selected Date Is Greater Than Tomorrow

His I want to check if the datetime select by user is greater than tomorrow and return to him an error.

This is my script. Please help me .

callFunction: function () {

      var tomorrow = new Date();
      var date = tomorrow.getFullYear()+'-'+(tomorrow.getMonth()+1)+'-'+(tomorrow.getDate() + 1);
      var time = tomorrow.getHours() + ":" + tomorrow.getMinutes() + ":" + tomorrow.getSeconds();
      var dateTime = date+' '+time;

      if(this.form.start >= dateTime){
        swal.fire(
            'Oops !',
            'The date you have chosen must be more than 24 hours.',
            'warning'
          )
      }
      console.log(dateTime);
    }
Oct
29
3 weeks ago
Activity icon

Started a new Conversation One To Many OR Many To Many

Hi every one,

I want to make this relationship : Doctor can add patients and patient can be added by multiple doctors.

Which eloquent relationships use : One To Many OR Many To Many ?

Thanks.

Oct
28
3 weeks ago
Activity icon

Started a new Conversation Send Email Notification When Using Api Controller

Hi,

I use api controller to add user, I want to send notification to user when he is added.

this is my notification controller

class AddDoctorNotification extends Notification { use Queueable;

//private $addDoctorNotification;

/**
 * Create a new notification instance.
 *
 * @return void
 */

/* public function __construct($addDoctorNotification) { $this->addDoctorNotification = $addDoctorNotification; } */

/**
 * Get the notification's delivery channels.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function via($notifiable)
{
    return ['mail'];
}

/**
 * Get the mail representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return \Illuminate\Notifications\Messages\MailMessage
 */
public function toMail($notifiable)
{
    return (new MailMessage)
                ->greeting("Compte créé")
                ->line("Votre clinique vous a créé un compte sur Docmava")
                ->action("url")
                ->line("Merci");
}


/**
 * Get the array representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return array
 */
public function toArray($notifiable)
{
    return [
        //
    ];
}

}

And this my api controller

/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) {

    $this->validate($request,[
        'firstname' => 'required|string|max:255',
        'lastname' => 'required|string|max:255',
        'email' => 'required|email|max:255|unique:doctors',
        'phone' => 'required',
        'password' => 'required|min:6',
    ]);

    $doctor =  Doctor::create([
        'firstname' => $request['firstname'],
        'lastname' => $request['lastname'],
        'specialty' => $request['specialty'],
        'email' => $request['email'],
        'phone' => $request['phone'],
        'password' => Hash::make($request['password']),
        'clinic_id' => auth('clinic')->user()->id,
    ]);

    return $doctor;

    $addDoctorNotification = [
        'greeting' => 'Hi',
        'body' => 'This is my first notification from me',
        'thanks' => 'Thank you for using me.com tuto!',
        'actionText' => 'View My Site',
        'actionURL' => url('/'),
    ];

    Notification::send($doctor, new AddDoctorNotification($addDoctorNotification));
}

But the notification is not send when user is added.

Please how can I make it ?

Oct
24
4 weeks ago
Oct
23
4 weeks ago
Activity icon

Started a new Conversation Vuejs Axios Laravel + Show Default Data And Change Data On Click Event

Hi I made list of users in which we can click on user to display user detail infos in right section.

I want to show the last user detail infos by default before clicking to change information.

Please I need your help.

Oct
18
1 month ago
Activity icon

Started a new Conversation Laravel Passpost With Multi Auth

Hi every one

How can I manage laravel API Passport with multi auth

'guards' => [
    'patient' => [
        'driver'   => 'session',
        'provider' => 'patients',
    ],

    'doctor' => [
        'driver'   => 'session',
        'provider' => 'doctors',
    ],

    'clinic' => [
        'driver'   => 'session',
        'provider' => 'clinics',
    ],

    'web' => [
        'driver' => 'session',
        'provider' => 'users',
    ],

    'api' => [
        'driver' => 'passport',
        'provider' => 'users',
        'hash' => false,
    ],

In route/api.php

Route::middleware('auth:api')->get('/user', function (Request $request) { return $request->user(); });

Route::group(['prefix' => 'clinic', 'namespace' => 'Clinic'], function() { Route::apiResources(['doctor' => 'API\DoctorController']); Route::apiResources(['doctorspeciality' => 'API\SpecialityController']); });

Oct
17
1 month ago
Activity icon

Started a new Conversation Store Authenticated User Id In Data When Creating Post With Multiple Guarde

I every one, I need your help

It is my first time to use Vue and laravel and API.

I created multi auth as Doctor auth, Clinic auth and Patient.

When you are logged as clinic, you can add doctor and patient related to this clinic.

I want to store clinic_id in database when creating doctors. This is my code

public function store(Request $request) {

    $this->validate($request,[
        'firstname' => 'required|string|max:255',
        'lastname' => 'required|string|max:255',
        'email' => 'required|email|max:255|unique:doctors',
        'phone' => 'required',
        'password' => 'required|min:6',
    ]);

    return Doctor::create([
        'firstname' => $request['firstname'],
        'lastname' => $request['lastname'],
        'specialty' => $request['specialty'],
        'email' => $request['email'],
        'phone' => $request['phone'],
        'password' => Hash::make($request['password']),
        'clinic_id' => Auth::guard('clinic')->user()->id,
    ]);
}

But I got this error : "Trying to get property 'id' of non-object",

How can I fixe that.

Thank you.

PS: Excuse me for my english. Am not googd in english

Sep
18
2 months ago
Activity icon

Replied to ISSUE FOR HTTP ERROR 500 ON SHARED HOSTING

Okay thank you.

Am getting this error.

Warning: require(/home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/../../App/Helper.php): failed to open stream: No such file or directory in /home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/autoload_real.php on line 66

Warning: require(/home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/../../App/Helper.php): failed to open stream: No such file or directory in /home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/autoload_real.php on line 66

Fatal error: require(): Failed opening required '/home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/../../App/Helper.php' (include_path='.:/opt/alt/php72/usr/share/pear') in /home/akeamazan/mes_sites_web/ecoles.tg/vendor/composer/autoload_real.php on line 66

How can I fixe that

Activity icon

Started a new Conversation ISSUE FOR HTTP ERROR 500 ON SHARED HOSTING

Please I deployed my laravel projet to server but am getting HTTP ERROR 500.

On my server I created folder name my_project on where I pointed my domaine name.

So I puted in my_projet folder my laravel project .

But am getting HTTP ERROR 500. Where can I resole that.

Thank you

Sep
06
2 months ago
Activity icon

Replied to Get Just Values In Array

Very good. Thanks

Activity icon

Started a new Conversation Get Just Values In Array

This my code

$years = $school->examen->pluck('year_exam');

    $years = json_decode($years);

    $years = array_unique($years);

    return $years;

It return

{ "0": 2014, "1": 2015, "3": 2017 }

I want just get values . how can I do it. Thanks

Activity icon

Started a new Conversation Make Multi Line Chart With Laravel Charts

id | exam_name | year_exam | exam_percentage | school_id

1 | BEPC | 2014 | 50 | 5

2 | BAC I | 2015 | 38 | 5

3 | BAC II | 2015 | 90 | 5

4 | BEPC | 2017 | 63 | 5

5 | BAC I | 2017 | 25 | 5

6 | BAC II | 2017 | 75 | 5

This is my database. I want to make charts based on exam name, exam year , percentage . and remove duplicate value form exam name and year exam. Labels is year exam , data is exam percentage and label is exam name .

This is how i done but it is not the result I want

    $result = $school->examen->pluck('exam_percentage');

    $year = $school->examen->pluck('year_exam');
    
    $chart = new ResultChart;
    $chart->labels(json_decode($year));

    $exam_name = $school->examen->pluck('exam_name');

    foreach ($exam_name as  $examen) {
        $examen;
    }
  
    $chart->dataset($examen, 'line', $result); 
    

    return view('frontend.details')

     ->with('school', $school)
     ->with('chart', $chart)
     ->with('ratings', School::paginate(5));

I use Laravel charts

Sep
04
2 months ago
Activity icon

Started a new Conversation Where Retrun Null If Using Wherehas After In Laravel Query

Where retrun null if using wherehas after in laravel query

This ->where('name', 'LIKE', '%'.$schoolname.'%') return nothing. Why?

public function listecoles(){

    $schoolname = request()->query('query');
    $location = request()->query('location');
    $type = request()->query('type');


    if($schoolname || $location || $type){

        $schools = School::with('types')
                    
                ->where('name', 'LIKE', '%'.$schoolname.'%')
            
                ->whereHas('ville', function ($query) use ($location) {
                    $query->where('name', $location);
                })

                ->orWhereHas('quartier', function ($query) use ($location) {
                    $query->where('name', $location);
                })
                
            ->paginate(10);   
            //return response()->json($schools);            
    }else{
        $schools = School::paginate(6); 
    }

    return view('frontend.liste-ecoles')
    ->with('statuts', Statut::all())
    ->with('types', Type::all())
    ->with('schools', $schools);      
   
}
Activity icon

Replied to Search Schools Based On Attached Type

I get this error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'schools.types_id' in 'where clause' (SQL: select count(*) as aggregate from schools where name LIKE %CEG Adidogomé% and exists (select * from `type where `school.`types_i = `type.`i and `nam = Collège) and `schoo..`deleted_ is null)

Activity icon

Replied to Search Schools Based On Attached Type

But I get this error

Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: Column not found: 1054 Unknown column 'types.name' in 'where clause' (SQL: select count(*) as aggregate from schools where name LIKE %CEG Adidogomé% and `type.`nam = Collège and `schoo..`deleted_ is null) Previous exceptions SQLSTATE[42S22]: Column not found: 1054 Unknown column 'types.name' in 'where clause' (42S22)

Activity icon

Replied to Search Schools Based On Attached Type

@sti3bas Here is my code but I can't acced to Types data

public function listecoles(){

    $query = request()->query('query');
    $location = request()->query('location');
    $type = request()->query('type');


    if($query || $location || $type){
        
        $schools = School::with('types')

                ->where('name', 'LIKE', '%'.$query.'%')

                ->when($type, function ($query, $type) {

                return $query->where('types.name', '=', $type);

                })
                
    ->paginate(10);                
           
    }else{
        $schools = School::paginate(6); 
    }

    return view('frontend.liste-ecoles')
    ->with('statuts', Statut::all())
    ->with('types', Type::all())
    ->with('schools', $schools);      
   
}
Activity icon

Replied to Search Schools Based On Attached Type

@sti3bas Please Table School don't contain typeID

Activity icon

Started a new Conversation Search Schools Based On Attached Type

Hi, I have school table and Type table, On creating school I attached Type.

I want to search schools based on attached type.

This is my school model

class School extends Model {

use SoftDeletes, SlugRoutable, Sluggable;


protected $fillable = [
    'name', 'statut_id', 'date_creation', 'description', 'logo', 'cover', 'email', 'phone',
     'website', 'ville_id', 'quartier_id', 'latitude', 'longitude', 'video_url', 'facebook', 'twitter', 'linkedin',
    'scholarite_info', 'avantage_sup', 'user_id'
];


public function types(){
    return $this->belongsToMany(Type::class);
}

}

And this my type model

class Type extends Model { protected $fillable = ['name'];

public function schools(){
    return $this->belongsToMany(School::class);
}

}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Please how can I get all schools based on attached type.