1. Go to this page and download the library: Download nncodes/laravel-meeting library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nncodes / laravel-meeting example snippets
use Nncodes\Meeting\Models\Meeting;
use Nncodes\Meeting\Models\MeetingRoom;
use App\Models\Event;
use App\Models\Teacher;
$meeting = Meeting::schedule()
->withTopic('English class: verb to be')
->startingAt(now()->addMinutes(30))
->during(40) //in Minutes
->scheduledBy(Event::find(1))
->presentedBy(Teacher::find(1))
->hostedBy(MeetingRoom::find(1))
->save();
/**
* Default Meeting Provider
*
* Here you can specify which meeting provider the package should use by
* default. Of course you may use many providers at once using the package.
*/
'default' => env('MEETING_PROVIDER', 'zoom'),
/**
* Meeting Providers
*
* Here are each of the meetings provider setup for the package.
*/
'providers' => [
'zoom' => [
/**
* Provider class
**/
'type' => \Nncodes\Meeting\Providers\Zoom\ZoomProvider::class,
/**
* JWT Zoom Token
* @see https://marketplace.zoom.us/docs/guides/auth/jwt
**/
'jwt_token' => env('ZOOM_TOKEN'),
/**
* Zoom Group ID
*
* @see https://marketplace.zoom.us/docs/api-reference/zoom-api/groups/group
**/
'group_id' => env('ZOOM_GROUP'),
/**
* Share Rooms
*
* Delegate to the package the responsability of handling the allocations of rooms.
**/
'share_rooms' => true,
/**
* Meeting resource seetings
*
* @see https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meeting
**/
'meeting_settings' => [
"host_video" => false,
"participant_video" => false,
"join_before_host" => false,
"jbh_time" => 0,
"mute_upon_entry" => true,
"approval_type" => 0,
"registration_type" => 1,
"close_registration" => true,
"waiting_room" => true,
"registrants_confirmation_email" => false,
"registrants_email_notification" => false,
"meeting_authentication" => false
]
]
],
/**
* Allow concurrent Meetings
*/
'allow_concurrent_meetings' => [
'host' => false,
'participant' => false,
'presenter' => false,
'scheduler' => true,
]
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Nncodes\Meeting\Concerns\SchedulesMeetings;
use Nncodes\Meeting\Contracts\Scheduler;
class Event extends Model implements Scheduler
{
use SchedulesMeetings;
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Nncodes\Meeting\Concerns\PresentsMeetings;
use Nncodes\Meeting\Contracts\Presenter;
class Teacher extends User implements Presenter
{
use PresentsMeetings;
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Nncodes\Meeting\Concerns\HostsMeetings;
use Nncodes\Meeting\Contracts\Host;
class Room extends Model implements Host
{
use HostsMeetings;
}
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Nncodes\Meeting\Concerns\JoinsMeetings;
use Nncodes\Meeting\Contracts\Participant;
class Student extends User implements Participant
{
use JoinsMeetings;
/**
* Email Address of the participant
*
* @return string
*/
public function getParticipantEmailAddress(): string
{
return $this->email;
}
/**
* First name of the participant
*
* @return string
*/
public function getParticipantFirstName(): string
{
return $this->first_name;
}
/**
* Last name of the participant
*
* @return string
*/
public function getParticipantLastName(): string
{
return $this->last_name;
}
}
use Nncodes\Meeting\Models\Meeting;
use App\Models\Event;
use App\Models\Teacher;
use App\Models\Room;
$event = Event::find(1);
$teacher = Teacher::find(1);
$room = Room::find(1);
$meeting = Meeting::schedule()
->withTopic('English class: verb to be')
->startingAt(now()->addMinutes(30))
->during(40) //minutes
->scheduledBy($event)
->presentedBy($teacher)
->hostedBy($room)
->save();
use Nncodes\Meeting\Models\Meeting;
use App\Models\Event;
use App\Models\Teacher;
use App\Models\Room;
$event->scheduleMeeting()
->withTopic('English class: verb to be')
->startingAt(now()->addMinutes(30))
->during(40) //minutes
->presentedBy($teacher)
->hostedBy($room)
->save()
use Nncodes\Meeting\Models\Meeting;
use App\Models\Event;
use App\Models\Teacher;
use App\Models\Room;
$meeting = Meeting::find(1);
$meeting->updateTopic('English class: Introducing Yourself')
->updateDuration(60)
->updateStartTime(now())
->updateScheduler(Event::find(1))
->updatePresenter(Teacher::find(5))
->updateHost(Room::find(1))
->save();
use Nncodes\Meeting\Models\Meeting;
use App\Models\Student;
$meeting = Meeting::find(1);
$student = Student::find(1);
//By the meeting model
$meeting->addParticipant($student);
//Or by the participant model
$student->bookMeeting($meeting);
use Nncodes\Meeting\Models\Meeting;
Meeting::find(1)->getPresenterAccess();
use Nncodes\Meeting\Models\Meeting;
use App\Models\Student;
$student = Student::find(1);
Meeting::find(1)>getParticipantAccess($student);
use Nncodes\Meeting\Models\Meeting;
use App\Models\Event;
use App\Models\Teacher;
$meeting = Meeting::schedule()
->withTopic('English class: verb to be')
->startingAt(now()->addMinutes(30))
->during(40) //minutes
->scheduledBy(Event::find(1))
->presentedBy(Teacher::find(1))
->save();