Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 12
HomeController
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 12
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 index
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 sendNotification
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 10
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\User;
use Notification;
use App\Notifications\ArticlesNotification;
use Config;
use Illuminate\View\View;
class HomeController extends Controller
{
    private $view = 'web.';
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        // $this->middleware('auth')->except('lang');
    }
    /**
     * Show the application dashboard.
     *
     * @return \View
     */
    public function index(): View
    {
        return view($this->view.'home');
    }
    /**
     * Send Notification.
     *
     * @return void
     */
    public function sendNotification()
    {
        // dd(Config::get('mail'));
        //get users from settings
        $user = User::first();
        $details = [
            'subject' => 'New Article',
            'greeting' => 'Hi Artisan',
            'body' => 'This is my first notification from ItSolutionStuff.com',
            'thanks' => 'Thank you for using ItSolutionStuff.com tuto!',
            'actionText' => 'View My Site',
            'actionURL' => url('/article/101'),
            'article_id' => 101
        ];
        // Notification::send($user, new ArticlesNotification($details));
        $user->notify(new ArticlesNotification($details));
        // dd('done');
    }
}