Skip to content

Commit

Permalink
update 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
subhadipghorui committed Jul 6, 2023
1 parent 2c88db5 commit a3e16ec
Show file tree
Hide file tree
Showing 3,015 changed files with 560,909 additions and 54 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function store(Request $request)
$post->save();

// Notification by mail
if($post->status){
if($request->notify){
$users = User::all();
foreach($users as $user){
// Mail::to($user->email)->queue(new NewPost($post));
Expand Down Expand Up @@ -194,7 +194,7 @@ public function update(Request $request, $id)
}
$post->save();
// Notification by mail
if($post->status){
if($request->notify){
$users = User::all();
foreach($users as $user){
// Mail::to($user->email)->queue(new NewPost($post));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function handleProviderCallback()
$newUser->name = $user->name;
$newUser->email_verified_at = Date::now();
$newUser->userid = $user->id;
$newUser->password = uniqid().Str::random(10); // we dont need password for login. For random number we user Str::random()
$newUser->password = bcrypt(uniqid()); // we dont need password for login. For random number we user Str::random()
$newUser->save();

// Login
Expand Down
11 changes: 11 additions & 0 deletions app/Http/Controllers/CommentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
namespace App\Http\Controllers;

use App\Comment;
use App\Notifications\NewCommentNotify;
use App\User;
use Brian2694\Toastr\Facades\Toastr;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Notification;

class CommentController extends Controller
{
Expand All @@ -18,6 +21,14 @@ public function store(Request $request, $post)
$comment->message = $request->message; //change comment field to message
$comment->save();

// Notify
$admins = User::where('role_id', 1)->get();
foreach($admins as $admin){
Notification::route('mail', $admin->email)
->notify(new NewCommentNotify($comment));

}

// Success message
Toastr::success('success', 'The comment created successfully ;)');
return redirect()->back();
Expand Down
12 changes: 12 additions & 0 deletions app/Http/Controllers/CommentReplyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
namespace App\Http\Controllers;

use App\CommentReply;
use App\Notifications\ReplyCommentNotify;
use App\User;
use Brian2694\Toastr\Facades\Toastr;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Notification;

class CommentReplyController extends Controller
{
Expand All @@ -18,6 +21,15 @@ public function store(Request $request, $comment)
$commentReply->message = $request->message;
$commentReply->save();

// Notify User
$admins = User::where('role_id', 1)->get();
foreach($admins as $admin){
Notification::route('mail', $admin->email)
->notify(new ReplyCommentNotify($commentReply));

}
Notification::route('mail', $commentReply->comment->user->email)
->notify(new ReplyCommentNotify($commentReply));
// Success message
Toastr::success('success', 'The comment replied successfully ;)');
return redirect()->back();
Expand Down
65 changes: 65 additions & 0 deletions app/Notifications/NewCommentNotify.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class NewCommentNotify extends Notification implements ShouldQueue
{
use Queueable;
public $comment;

/**
* Create a new notification instance.
*/
public function __construct($comment)
{
$this->comment = $comment;
}

/**
* 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())
->subject('New Comment')
->greeting('Post : '.$this->comment->post->title)
->line('User : '.$this->comment->user->name)
->line('Comment : '.$this->comment->message)
->action('View Post', url(route('post', $this->comment->post->slug)))
->line('Thank you.');
}

/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
2 changes: 1 addition & 1 deletion app/Notifications/NewPostNotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function via($notifiable)
public function toMail($notifiable)
{
return (new MailMessage())
->subject('New Post Availabel')
->subject('New Post Available !!')
->greeting('Title : '.$this->post->title)
->line('Category : '.$this->post->category->name)
->line('Author : '.$this->post->user->name)
Expand Down
65 changes: 65 additions & 0 deletions app/Notifications/ReplyCommentNotify.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class ReplyCommentNotify extends Notification implements ShouldQueue
{
use Queueable;
public $replyComment;

/**
* Create a new notification instance.
*/
public function __construct($replyComment)
{
$this->replyComment = $replyComment;
}

/**
* 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())
->subject('Re: '. $this->replyComment->comment->message)
->greeting('Post : '.$this->replyComment->comment->post->title)
->line('User : '.$this->replyComment->user->name)
->line('Comment : '.$this->replyComment->message)
->action('View Post', url(route('post', $this->replyComment->comment->post->slug)))
->line('Thank you.');
}

/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}
2 changes: 1 addition & 1 deletion config/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
/*
* The number of days for which backups must be kept.
*/
'keep_all_backups_for_days' => 7,
'keep_all_backups_for_days' => 10,

/*
* The number of days for which daily backups must be kept.
Expand Down
21 changes: 21 additions & 0 deletions public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
2,462 changes: 2,462 additions & 0 deletions public/backend/assets/css/style.css

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions public/backend/assets/css/style.css.map

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions public/backend/assets/js/dashboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
( function ( $ ) {
"use strict";


// const brandPrimary = '#20a8d8'
const brandSuccess = '#4dbd74'
const brandInfo = '#63c2de'
const brandDanger = '#f86c6b'

function convertHex (hex, opacity) {
hex = hex.replace('#', '')
const r = parseInt(hex.substring(0, 2), 16)
const g = parseInt(hex.substring(2, 4), 16)
const b = parseInt(hex.substring(4, 6), 16)

const result = 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')'
return result
}

function random (min, max) {
return Math.floor(Math.random() * (max - min + 1) + min)
}

var elements = 27
var data1 = []
var data2 = []
var data3 = []

for (var i = 0; i <= elements; i++) {
data1.push(random(50, 200))
data2.push(random(80, 100))
data3.push(65)
}


//Traffic Chart
var ctx = document.getElementById( "trafficChart" );
//ctx.height = 200;
var myChart = new Chart( ctx, {
type: 'line',
data: {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S'],
datasets: [
{
label: 'My First dataset',
backgroundColor: convertHex(brandInfo, 10),
borderColor: brandInfo,
pointHoverBackgroundColor: '#fff',
borderWidth: 2,
data: data1
},
{
label: 'My Second dataset',
backgroundColor: 'transparent',
borderColor: brandSuccess,
pointHoverBackgroundColor: '#fff',
borderWidth: 2,
data: data2
},
{
label: 'My Third dataset',
backgroundColor: 'transparent',
borderColor: brandDanger,
pointHoverBackgroundColor: '#fff',
borderWidth: 1,
borderDash: [8, 5],
data: data3
}
]
},
options: {
// maintainAspectRatio: true,
// legend: {
// display: false
// },
// scales: {
// xAxes: [{
// display: false,
// categoryPercentage: 1,
// barPercentage: 0.5
// }],
// yAxes: [ {
// display: false
// } ]
// }


maintainAspectRatio: true,
legend: {
display: false
},
responsive: true,
scales: {
xAxes: [{
gridLines: {
drawOnChartArea: false
}
}],
yAxes: [ {
ticks: {
beginAtZero: true,
maxTicksLimit: 5,
stepSize: Math.ceil(250 / 5),
max: 250
},
gridLines: {
display: true
}
} ]
},
elements: {
point: {
radius: 0,
hitRadius: 10,
hoverRadius: 4,
hoverBorderWidth: 3
}
}


}
} );


} )( jQuery );
Empty file.
Loading

0 comments on commit a3e16ec

Please sign in to comment.