Skip to content

Instantly share code, notes, and snippets.

View victorsteven's full-sized avatar

Victor Steven victorsteven

View GitHub Profile
@victorsteven
victorsteven / create_messages_table.php
Last active April 15, 2019 16:15
messages migration file
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMessagesTable extends Migration
{
/**
* Run the migrations.
@victorsteven
victorsteven / UsersTableSeeder.php
Created April 15, 2019 16:19
Users Table Seeder file
<?php
use Illuminate\Database\Seeder;
use App\User;
use Faker\Factory;
class UsersTableSeeder extends Seeder
{
/**
* Run the database seeds.
@victorsteven
victorsteven / MessageController.php
Created April 15, 2019 16:38
Message Controller file
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Message;
use App\Jobs\SendMailJob;
use Carbon\Carbon;
use App\User;
use App\Mail\NewArrivals;
@victorsteven
victorsteven / SendMailJob.php
Created April 15, 2019 16:52
SendMailJob file
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Mail;
@victorsteven
victorsteven / NewArrival.php
Created April 15, 2019 16:58
NewArrival mail class
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class NewArrivals extends Mailable
@victorsteven
victorsteven / web.php
Last active April 15, 2019 17:06
Route file
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
@victorsteven
victorsteven / NewArrivals.vue
Last active April 15, 2019 17:31
The New Arrivals vue file
<template>
<div>
<div class="card col-md-8 offset-md-2" style="margin-top: 20px;">
<div class="card-header">
<div style="display:flex; justify-content: space-between;">
<h2>Email List</h2>
<a id="create_form_icon" href="#"
class="btn btn-lg btn-primary"
@click="openModal"
>
@victorsteven
victorsteven / app.js
Last active April 15, 2019 17:34
app.js file
require('./bootstrap');
window.Vue = require('vue');
import swal from 'sweetalert2';
window.swal = swal;
import VueCtkDateTimePicker from 'vue-ctk-date-time-picker';
import 'vue-ctk-date-time-picker/dist/vue-ctk-date-time-picker.css';
@victorsteven
victorsteven / NotifyUsers.php
Last active April 15, 2019 17:56
NotifyUsers Artisan Command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Message;
use Carbon\Carbon;
use App\Jobs\SendMailJob;
use App\User;
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Datatable</title>
<link rel="stylesheet"