Unverified Commit 9f36ea78 authored by Vipul Basapati's avatar Vipul Basapati Committed by GitHub

Mailables (#278)

* removed generator resources/vendor files

* resolved html flash <br/> in validation messages issue

* updated fronted account section to remove address, state, city, ssn and zipcode as we are not using it anywhere

* Changes in Role Module

* Permission API Changes

* Add User's permission in Custom claims

* Modified the Blogs Request on web and api to check for publish_datetime #250

Fixed style CI issues

* removed generator resources/vendor files

* resolved html flash <br/> in validation messages issue

* updated fronted account section to remove address, state, city, ssn and zipcode as we are not using it anywhere

* Modified the Blogs Request on web and api to check for publish_datetime #250

Fixed style CI issues

* Fixed Menu issue

* fixed table names from faqs repository

* Bug fixes (#255)

* removed generator resources/vendor files

* resolved html flash <br/> in validation messages issue

* updated fronted account section to remove address, state, city, ssn and zipcode as we are not using it anywhere

* Modified the Blogs Request on web and api to check for publish_datetime #250

Fixed style CI issues

* Fixed Menu issue

* Update README.md

* fixed table names from faqs repository

* Email Templates as a file (#260)

* Update README.md

* from one line to view format

* change in vue version

* view file for email template

* Changes in Template styling and usage of non-static values in template.blade.php

* Email templates abatra (#263)

* from one line to view format

* change in vue version

* view file for email template

* Implaement Responsive Email Template

* Update package.json

* Removed mjml dependency

* Add Dynamic Confirmation Link

* upgrade to laravel5.7

* upgrade npm

* Adding analytics for dashboard

* Apply fixes from StyleCI

* 1. Fixed Pages Api bug.
2. Added Email Template Mailable for Forgot Password.
3. Added Email Template Mailable for Reset Password.
4. Added Email Template Mailable for Change Password.
5. Updated email template css.

* Fixed StyleCI issues

* Fixed StyleCI issues
parent 553fde65
APP_NAME="Laravel Admin Panel"
APP_SHORT_NAME="LAP"
APP_ENV=local
APP_KEY=base64:O+TrollIDwasHEREtMG9kBc+/Q32exQLusNVhnq558w=
APP_DEBUG=true
......
......@@ -121,9 +121,12 @@ class BlogsController extends APIController
{
$featured_image = ($action == 'insert') ? 'required' : '';
$publish_datetime = $request->publish_datetime !== '' ? 'required|date' : 'required';
$validation = Validator::make($request->all(), [
'name' => 'required|max:191',
'featured_image' => $featured_image,
'publish_datetime' => $publish_datetime,
'content' => 'required',
'categories' => 'required',
'tags' => 'required',
......
......@@ -31,7 +31,7 @@ class PagesController extends APIController
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
$orderBy = $request->get('orderBy') ? $request->get('orderBy') : 'ASC';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : 'created_at';
$sortBy = $request->get('sortBy') ? $request->get('sortBy') : config('module.pages.table', 'pages').'created_at';
return PagesResource::collection(
$this->repository->getForDataTable()->orderBy($sortBy, $orderBy)->paginate($limit)
......
......@@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
use App\Models\Access\Permission\Permission;
use App\Models\Access\Role\Role;
use App\Models\Access\User\User;
use App\Models\Settings\Setting;
use Illuminate\Http\Request;
/**
......@@ -18,7 +19,10 @@ class DashboardController extends Controller
*/
public function index()
{
return view('backend.dashboard');
$settingData = Setting::first();
$google_analytics = $settingData->google_analytics;
return view('backend.dashboard', compact('google_analytics', $google_analytics));
}
/**
......
......@@ -95,11 +95,12 @@ class ResetPasswordController extends Controller
/**
* Get the response for a successful password reset.
*
* @param \Illuminate\Http\Request $request
* @param string $response
*
* @return \Illuminate\Http\RedirectResponse
*/
protected function sendResetResponse($response)
protected function sendResetResponse($request, $response)
{
return redirect()->route(homeRoute())->withFlashSuccess(trans($response));
}
......
......@@ -29,6 +29,7 @@ class StoreBlogsRequest extends Request
return [
'name' => 'required|max:191',
'featured_image' => 'required',
'publish_datetime' => 'required|date',
'content' => 'required',
'categories' => 'required',
'tags' => 'required',
......
......@@ -28,6 +28,7 @@ class UpdateBlogsRequest extends Request
{
return [
'name' => 'required|max:191|unique:blogs,name,'.$this->segment(3),
'publish_datetime' => 'required|date',
'content' => 'required',
'categories' => 'required',
'tags' => 'required',
......
......@@ -31,10 +31,6 @@ class UpdateProfileRequest extends Request
'first_name' => 'required|max:255',
'last_name' => 'required|max:255',
'email' => ['sometimes', 'required', 'email', 'max:255', Rule::unique('users')],
'state_id' => 'required',
'city_id' => 'required',
'zip_code' => 'required',
'ssn' => 'required',
];
}
}
......@@ -20,8 +20,8 @@ class PermissionResource extends Resource
'name' => $this->name,
'display_name' => $this->display_name,
'sort' => $this->sort,
'registered_at' => $this->created_at->toIso8601String(),
'last_updated_at' => $this->updated_at->toIso8601String(),
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
];
}
......
......@@ -22,8 +22,8 @@ class RoleResource extends Resource
'number_of_users' => $this->users->count(),
'sort' => $this->sort,
'status' => $this->status,
'registered_at' => $this->created_at->toIso8601String(),
'last_updated_at' => $this->updated_at->toIso8601String(),
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
];
}
}
......@@ -34,21 +34,6 @@ class UserEventListener
\Log::info('User Registered: '.$event->user->full_name);
}
/**
* @param $event
*/
/*public function onRegistered($event)
{
\Log::info('User Registered: '.$event->user->first_name);
// Send email to the user
$options = [
'data' => $event->user,
'email_template_type' => 1,
];
createNotification('', 1, 2, $options);
}*/
/**
* @param $event
*/
......
......@@ -147,23 +147,22 @@ trait UserAttribute
switch ($this->status) {
case 0:
if (access()->allow('activate-user')) {
$name = $class == '' ? 'Active' : '';
$name = $class == '' ? 'Activate' : '';
return '<a class="'.$class.'" href="'.route('admin.access.user.mark', [$this, 1]).'"><i class="fa fa-check-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.activate').'"></i>'.$name.'</a>';
}
// No break
break;
case 1:
if (access()->allow('deactivate-user')) {
$name = ($class == '') ? 'Deactive' : '';
$name = ($class == '') ? 'Deactivate' : '';
return '<a class="'.$class.'" href="'.route('admin.access.user.mark', [$this, 0]).'"><i class="fa fa-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.deactivate').'"></i>'.$name.'</a>';
}
// No break
break;
default:
return '';
// No break
}
}
......
......@@ -92,8 +92,11 @@ class User extends Authenticatable implements JWTSubject
'email' => $this->email,
'picture' => $this->getPicture(),
'confirmed' => $this->confirmed,
'registered_at' => $this->created_at->toIso8601String(),
'last_updated_at' => $this->updated_at->toIso8601String(),
'role' => optional($this->roles()->first())->name,
'permissions' => $this->permissions()->get(),
'status' => $this->status,
'created_at' => $this->created_at->toIso8601String(),
'updated_at' => $this->updated_at->toIso8601String(),
];
}
}
<?php
namespace App\Notifications\Frontend\Auth;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
/**
* Class UserChangedPassword.
*/
class UserChangedPassword extends Notification
{
use Queueable;
/**
* @var
*/
protected $password;
/**
* UserChangedPassword constructor.
*
* @param $password
*/
public function __construct($password)
{
$this->password = $password;
}
/**
* 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 \App\Models\Access\User\User $user
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($user)
{
return (new MailMessage())
->view('emails.changed-password', ['password' => $this->password]);
}
}
......@@ -43,16 +43,15 @@ class UserNeedsConfirmation extends Notification
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @param \App\Models\Access\User\User $user
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail($user)
{
$confirmation_url = route('frontend.auth.account.confirm', $user->confirmation_code);
return (new MailMessage())
->subject(app_name().': '.trans('exceptions.frontend.auth.confirmation.confirm'))
->line(trans('strings.emails.auth.click_to_confirm'))
->action(trans('buttons.emails.auth.confirm_account'), route('frontend.auth.account.confirm', $this->confirmation_code))
->line(trans('strings.emails.auth.thank_you_for_using_app'));
->view('emails.user-confirmation', ['confirmation_url' => $confirmation_url]);
}
}
......@@ -50,10 +50,9 @@ class UserNeedsPasswordReset extends Notification
*/
public function toMail($notifiable)
{
$reset_password_route = route('frontend.auth.password.reset.form', $this->token);
return (new MailMessage())
->subject(app_name().': '.trans('strings.emails.auth.password_reset_subject'))
->line(trans('strings.emails.auth.password_cause_of_email'))
->action(trans('buttons.emails.auth.reset_password'), route('frontend.auth.password.reset.form', $this->token))
->line(trans('strings.emails.auth.password_if_not_requested'));
->view('emails.reset-password', ['reset_password_url' => $reset_password_route]);
}
}
......@@ -23,8 +23,8 @@ class FaqsRepository extends BaseRepository
{
return $this->query()
->select([
config('mdule.faqs.able').'.id',
config('odule.faqs.table').'.question',
config('module.faqs.table').'.id',
config('module.faqs.table').'.question',
config('module.faqs.table').'.answer',
config('module.faqs.table').'.status',
config('module.faqs.table').'.created_at',
......
......@@ -6,6 +6,7 @@ use App\Events\Frontend\Auth\UserConfirmed;
use App\Exceptions\GeneralException;
use App\Models\Access\User\SocialLogin;
use App\Models\Access\User\User;
use App\Notifications\Frontend\Auth\UserChangedPassword;
use App\Notifications\Frontend\Auth\UserNeedsConfirmation;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\BaseRepository;
......@@ -115,7 +116,7 @@ class UserRepository extends BaseRepository
$user->confirmed = 1;
}
DB::transaction(function () use ($user) {
DB::transaction(function () use ($user, $provider) {
if ($user->save()) {
/*
......@@ -130,8 +131,6 @@ class UserRepository extends BaseRepository
* Assigned permissions to user
*/
$user->permissions()->sync($permissions);
}
});
/*
* If users have to confirm their email and this is not a social account,
......@@ -142,6 +141,8 @@ class UserRepository extends BaseRepository
if (config('access.users.confirm_email') && $provider === false) {
$user->notify(new UserNeedsConfirmation($user->confirmation_code));
}
}
});
/*
* Return the user object
......@@ -242,12 +243,6 @@ class UserRepository extends BaseRepository
$user = $this->find($id);
$user->first_name = $input['first_name'];
$user->last_name = $input['last_name'];
$user->address = $input['address'];
$user->state_id = $input['state_id'];
$user->country_id = config('access.constants.default_country');
$user->city_id = $input['city_id'];
$user->zip_code = $input['zip_code'];
$user->ssn = $input['ssn'];
$user->updated_by = access()->user()->id;
if ($user->canChangeEmail()) {
......@@ -292,13 +287,7 @@ class UserRepository extends BaseRepository
$user->password = bcrypt($input['password']);
if ($user->save()) {
$input['email'] = $user->email;
// Send email to the user
$options = [
'data' => $input,
'email_template_type' => 4,
];
createNotification('', $user->id, 2, $options);
$user->notify(new UserChangedPassword($input['password']));
return true;
}
......
This diff is collapsed.
......@@ -104,7 +104,7 @@ return [
/*
* Whether or not the user has to confirm their email when signing up
*/
'confirm_email' => false,
'confirm_email' => true,
/*
* Whether or not the users email can be changed on the edit profile screen
......
This diff is collapsed.
......@@ -11,13 +11,13 @@
},
"devDependencies": {
"axios": "^0.18",
"bootstrap-sass": "^3.3.7",
"bootstrap-sass": "3.3.7",
"cross-env": "^5.1",
"font-awesome": "^4.7.0",
"jquery": "^3.1.1",
"laravel-mix": "^2.0",
"laravel-mix": "^2.1.14",
"lodash": "^4.17.4",
"vue": "^2.5.7",
"vue": "^2.5.17",
"webpack-rtl-plugin": "^1.5.0"
},
"dependencies": {
......
# humanstxt.org/
# The humans responsible & technology colophon
# TEAM
<name> -- <role> -- <twitter>
# THANKS
<name>
# TECHNOLOGY COLOPHON
CSS3, HTML5
Apache Server Configs, jQuery, Modernizr, Normalize.css
......@@ -491,7 +491,7 @@ var Backend = {}; // common variable used in all the files of the backend
this.selectors.menuItemContainer.nestable({
callback: function (l, e) {
this.selectors.menuItemsData.val(JSON.stringify($(l).nestable('serialise')));
context.selectors.menuItemsData.val(JSON.stringify($(l).nestable('serialise')));
},
json: this.selectors.menuItemsData.val(),
includeContent: true,
......
<template>
<div :class="typeClass" v-show="show">
<div :class="typeClass" v-show="show" v-html="body">
{{ body }}
</div>
</template>
......
......@@ -188,7 +188,7 @@ return [
'blogs' => [
'title' => 'Blog Title',
'category' => 'Blog Category',
'publish' => 'Publich Date & Time',
'publish' => 'Publish Date & Time',
'image' => 'Featured Image',
'content' => 'Content',
'tags' => 'Tags',
......
......@@ -38,6 +38,11 @@
<script>
window.Laravel = {!! json_encode([ 'csrfToken' => csrf_token() ]) !!};
</script>
<?php
if(!empty($google_analytics)){
echo $google_analytics;
}
?>
</head>
<body class="skin-{{ config('backend.theme') }} {{ config('backend.layout') }}">
<div class="loading" style="display:none"></div>
......
@extends('emails.layouts.app')
@section('content')
<div class="content">
<td align="left">
<table border="0" width="80%" align="center" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="left" style="color: #888888; width:20px; font-size: 16px; line-height: 24px;">
<!-- section text ======-->
<p style="line-height: 24px; margin-bottom:15px;">
Hello!
</p>
<p style="line-height: 24px; margin-bottom:20px;">
Your Password has successfully been changed to : {{ $password }}
</p>
<p style="line-height: 24px; margin-bottom:20px;">
If you did not change your password, try resetting your password using above password.
</p>
<p style="line-height: 24px">
Regards,</br>
@yield('title', app_name())
</p>
<br/>
@include('emails.layouts.footer')
</td>
</tr>
</table>
</td>
</div>
@endsection
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
<meta name="viewport" content="width=600,initial-scale = 2.3,user-scalable=no">
<!--<![if !mso]-->
<link href="https://fonts.googleapis.com/css?family=Fira+Sans|Fira+Sans+Condensed|Raleway" rel="stylesheet">
<!--<![endif]-->
<title>@yield('title', app_name())</title>
<style type="text/css">
body {
width: 100%;
margin: 0;
padding: 0;
mso-margin-top-alt: 0px;
mso-margin-bottom-alt: 0px;
mso-padding-alt: 0px 0px 0px 0px;
-webkit-font-smoothing: antialiased;
background-color: #495867;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23a594c1' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
font-family: 'Fira Sans',Raleway, sans-serif;
}
p,
h1,
h2,
h3,
h4 {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
font-family: 'Fira Sans',Raleway, sans-serif;
}
span.preheader {
display: none;
font-size: 1px;
}
html {
width: 100%;
}
table {
font-size: 14px;
border: 0;
padding:10px;
width: 100%;
}
.lap{
color: #007bff;
text-decoration: none;
background-color: transparent;
}
.container{
margin-top: 25px;
margin-left: 25px;
margin-right: 25px;
}
.main-header {
color: #343434;
font-size: 24px;
font-weight:300;
line-height: 35px;
}
.main-header .brand {
letter-spacing: 5px;
font-size: 28px;
}
.main-header .tagline {
font-size: 16px;
}
.small {
font-size: 10px;
}
.center {
text-align: center;
}
/* ----------- responsivity ----------- */
@media only screen and (max-width: 640px) {
/*------ top header ------ */
.main-header {
font-size: 20px !important;
}
.main-section-header {
font-size: 28px !important;
}
.show {
display: block !important;
}
.hide {
display: none !important;
}
.align-center {
text-align: center !important;
}
.no-bg {
background: none !important;
}
/* ====== divider ====== */
.divider img {
width: 440px !important;
}
/*-------- container --------*/
.container590 {
width: 440px !important;
}
.container580 {
width: 400px !important;
}
.main-button {
width: 220px !important;
}
}
@media only screen and (max-width: 479px) {
/*------ top header ------ */
.main-header {
font-size: 18px !important;
}
.main-section-header {
font-size: 26px !important;
}
/*-------- container --------*/
.container590 {
width: 210px !important;
}
.container590 {
width: 210px !important;
}
.container580 {
width: 260px !important;
}
}
</style>
</head>
<body class="respond" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div class="container">
<table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="ffffff" style="width:60%; margin: 0 auto;" class="bg_color">
<tr>
<td align="center">
<table border="0" align="center" width="590" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="center">
<table border="0" width="40" align="center" cellpadding="0" cellspacing="0" bgcolor="eeeeee">
<tr>
<td align="center" style=""
class="main-header">
<!-- section text ======-->
<div class="brand">{{ env('APP_SHORT_NAME', 'LAP') }}</div>
<div class="tagline">
{{ app_name() }}
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td>
</tr>
<tr>
@yield('content')
</tr>
</table>
</td>
</tr>
<tr>
<td height="40" style="font-size: 40px; line-height: 40px;">&nbsp;</td>
</tr>
</table>
</div>
<!-- end section -->
</body>
</html>
\ No newline at end of file
<p class="small center" style="line-height: 24px; margin-bottom: 20px;">
©2018 <a href="{{ url('/') }}" target="_blank" class="lap">@yield('title', app_name())</a>
All Rights are Reserved.
</p>
\ No newline at end of file
@extends('emails.layouts.app')
@section('content')
<div class="content">
<td align="left">
<table border="0" width="80%" align="center" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="left" style="color: #888888; width:20px; font-size: 16px; line-height: 24px;">
<!-- section text ======-->
<p style="line-height: 24px; margin-bottom:15px;">
Hello!
</p>
<p style="line-height: 24px; margin-bottom:20px;">
You are receiving this email because we received a password reset request for your account.
</p>
<table border="0" align="center" width="180" cellpadding="0" cellspacing="0" bgcolor="5caad2" style="margin-bottom:20px; background: #003bd7; border-radius: 5px;">
<tr>
<td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td>
</tr>
<tr>
<td align="center" style="color: #ffffff; font-size: 14px; line-height: 22px;letter-spacing: 1px;font-weight: bold;">
<!-- main section button -->
<div style="line-height: 22px;">
<a href="{{ $reset_password_url }}" style="color: #ffffff; text-decoration: none;">Reset Password</a>
</div>
</td>
</tr>
<tr>
<td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td>
</tr>
</table>
<p style="line-height: 24px; margin-bottom:20px;">
If you did not request a password reset, no further action is required.
</p>
<p style="line-height: 24px">
Regards,</br>
@yield('title', app_name())
</p>
<br/>
<p class="small" style="line-height: 24px; margin-bottom:20px;">
If you’re having trouble clicking the "Reset Password" button, copy and paste the URL below into your web browser:
</p>
<p class="small" style="line-height: 24px; margin-bottom:20px;">
<a href="{{ $reset_password_url }}" target="_blank" class="lap">
{{ $reset_password_url}}
</a>
</p>
@include('emails.layouts.footer')
</td>
</tr>
</table>
</td>
</div>
@endsection
\ No newline at end of file
{!! $data !!}
\ No newline at end of file
@extends('emails.layouts.app')
@section('content')
<div class="content">
<td align="left">
<table border="0" width="80%" align="center" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="left" style="color: #888888; width:20px; font-size: 16px; line-height: 24px;">
<!-- section text ======-->
<p style="line-height: 24px; margin-bottom:15px;">
Hello!
</p>
<p style="line-height: 24px; margin-bottom:20px;">
Click here to confirm your account:
</p>
<table border="0" align="center" width="180" cellpadding="0" cellspacing="0" bgcolor="5caad2" style="margin-bottom:20px; background: #003bd7; border-radius: 5px;">
<tr>
<td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td>
</tr>
<tr>
<td align="center" style="color: #ffffff; font-size: 14px; line-height: 22px;letter-spacing: 1px;font-weight: bold;">
<!-- main section button -->
<div style="line-height: 22px;">
<a href="{{ $confirmation_url }}" style="color: #ffffff; text-decoration: none;">Confirm Account</a>
</div>
</td>
</tr>
<tr>
<td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td>
</tr>
</table>
<p style="line-height: 24px; margin-bottom:20px;">
Thank you for using our application!
</p>
<p style="line-height: 24px">
Regards,</br>
@yield('title', app_name())
</p>
<br/>
<p class="small" style="line-height: 24px; margin-bottom:20px;">
If you’re having trouble clicking the "Confirm Account" button, copy and paste the URL below into your web browser:
</p>
<p class="small" style="line-height: 24px; margin-bottom:20px;">
<a href="{{ $confirmation_url }}" target="_blank" class="lap">
{{ $confirmation_url}}
</a>
</p>
@include('emails.layouts.footer')
</td>
</tr>
</table>
</td>
</div>
@endsection
\ No newline at end of file
......@@ -89,58 +89,6 @@
$("#edit").removeClass("active");
}
//Getting States of default contry
ajaxCall("{{route('frontend.get.states')}}");
//Getting Cities of select State
$("#state").on("change", function() {
var stateId = $(this).val();
var url = "{{route('frontend.get.cities')}}";
ajaxCall(url, stateId);
});
function ajaxCall(url, data = null)
{
$.ajax({
url: url,
type: "POST",
data: {stateId: data},
success: function(result) {
if(result != null)
{
if(result.status == "city")
{
var userCity = "{{ $logged_in_user->city_id }}";
var options;
$.each(result.data, function(key, value) {
if(key == userCity)
options += "<option value='" + key + "' selected>" + value + "</option>";
else
options += "<option value='" + key + "'>" + value + "</option>";
});
$("#city").html('');
$("#city").append(options);
}
else
{
var userState = "{{ $logged_in_user->state_id }}";
var options;
$.each(result.data, function(key, value) {
if(key == userState)
options += "<option value='" + key + "' selected>" + value + "</option>";
else
options += "<option value='" + key + "'>" + value + "</option>";
});
$("#state").append(options);
$("#state").trigger('change');
}
}
}
});
}
$(".tabs").click(function() {
var tab = $(this).attr("aria-controls");
$.session.set("tab", tab);
......
......@@ -27,45 +27,6 @@
</div>
@endif
<div class="form-group">
{{ Form::label('address', trans('validation.attributes.frontend.register-user.address'), ['class' => 'col-md-4 control-label']) }}
<div class="col-md-6">
{{ Form::input('textarea', 'address', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.address')]) }}
</div>
</div>
{{-- state --}}
<div class="form-group">
{{ Form::label('state_id', trans('validation.attributes.frontend.register-user.state'), ['class' => 'col-md-4 control-label']) }}
<div class="col-md-6">
{{ Form::select('state_id', [] , null, ['class' => 'form-control select2', 'placeholder' => trans('validation.attributes.frontend.register-user.state'), 'id' => 'state', 'style' => 'width : 539px !important;']) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- city --}}
<div class="form-group">
{{ Form::label('city_id', trans('validation.attributes.frontend.register-user.city'), ['class' => 'col-md-4 control-label']) }}
<div class="col-md-6">
{{ Form::select('city_id', [], null, ['class' => 'form-control select2', 'placeholder' => trans('validation.attributes.frontend.register-user.city'), 'id' => 'city', 'style' => 'width : 539px !important;']) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- zipcode --}}
<div class="form-group">
{{ Form::label('zip_code', trans('validation.attributes.frontend.register-user.zipcode'), ['class' => 'col-md-4 control-label']) }}
<div class="col-md-6">
{{ Form::input('name', 'zip_code', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.zipcode')]) }}
</div><!--col-md-6-->
</div><!--form-group-->
{{-- SSN --}}
<div class="form-group">
{{ Form::label('ssn', trans('validation.attributes.frontend.register-user.ssn'), ['class' => 'col-md-4 control-label']) }}
<div class="col-md-6">
{{ Form::input('name', 'ssn', null, ['class' => 'form-control', 'placeholder' => trans('validation.attributes.frontend.register-user.ssn')]) }}
</div><!--col-md-6-->
</div><!--form-group-->
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
{{ Form::submit(trans('labels.general.buttons.update'), ['class' => 'btn btn-primary', 'id' => 'update-profile']) }}
......
......@@ -12,26 +12,6 @@
<th>{{ trans('labels.frontend.user.profile.email') }}</th>
<td>{{ !empty($logged_in_user->email) ? $logged_in_user->email : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.address') }}</th>
<td>{{ !empty($logged_in_user->address) ? $logged_in_user->address : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.state') }}</th>
<td>{{ !empty($logged_in_user->state->state) ? $logged_in_user->state->state : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.city') }}</th>
<td>{{ !empty($logged_in_user->city->city) ? $logged_in_user->city->city : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.zipcode') }}</th>
<td>{{ !empty($logged_in_user->zip_code) ? $logged_in_user->zip_code : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.ssn') }}</th>
<td>{{ !empty($logged_in_user->ssn) ? $logged_in_user->ssn : '' }}</td>
</tr>
<tr>
<th>{{ trans('labels.frontend.user.profile.created_at') }}</th>
<td>{{ $logged_in_user->created_at }} ({{ $logged_in_user->created_at->diffForHumans() }})</td>
......
<?php
namespace AttributeNamespace;
/**
* Class AttributeClass.
*/
trait AttributeClass
{
// Make your attributes functions here
// Further, see the documentation : https://laravel.com/docs/5.4/eloquent-mutators#defining-an-accessor
/**
* Action Button Attribute to show in grid
* @return string
*/
public function getActionButtonsAttribute()
{
return '<div class="btn-group action-btn">
'.$this->getEditButtonAttribute("editPermission", "editRoute").'
'.$this->getDeleteButtonAttribute("deletePermission", "deleteRoute").'
</div>';
}
}
<?php
Breadcrumbs::register('admin.dummy_small_plural_model.index', function ($breadcrumbs) {
$breadcrumbs->parent('admin.dashboard');
$breadcrumbs->push(trans('menus.backend.dummy_small_plural_model.management'), route('admin.dummy_small_plural_model.index'));
});
Breadcrumbs::register('admin.dummy_small_plural_model.create', function ($breadcrumbs) {
$breadcrumbs->parent('admin.dummy_small_plural_model.index');
$breadcrumbs->push(trans('menus.backend.dummy_small_plural_model.create'), route('admin.dummy_small_plural_model.create'));
});
Breadcrumbs::register('admin.dummy_small_plural_model.edit', function ($breadcrumbs, $id) {
$breadcrumbs->parent('admin.dummy_small_plural_model.index');
$breadcrumbs->push(trans('menus.backend.dummy_small_plural_model.edit'), route('admin.dummy_small_plural_model.edit', $id));
});
<?php
namespace DummyNamespace;
use DummyModelNamespace;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DummyRepositoryNamespace;
use DummyManageRequestNamespace;
@Namespaces
/**
* DummyController
*/
class DummyController extends Controller
{
/**
* variable to store the repository object
* @var dummy_repository
*/
protected $repository;
/**
* contructor to initialize repository object
* @param dummy_repository $repository;
*/
public function __construct(dummy_repository $repository)
{
$this->repository = $repository;
}
/**
* Display a listing of the resource.
*
* @param DummyManageRequestNamespace $request
* @return \Illuminate\Http\Response
*/
public function index(DummyManageRequest $request)
{
return view('backend.dummy_small_plural_model.index');
}
@startCreate/**
* Show the form for creating a new resource.
*
* @param DummyCreateRequestNamespace $request
* @return \Illuminate\Http\Response
*/
public function create(DummyCreateRequest $request)
{
return view('backend.dummy_small_plural_model.create');
}
/**
* Store a newly created resource in storage.
*
* @param DummyStoreRequestNamespace $request
* @return \Illuminate\Http\Response
*/
public function store(DummyStoreRequest $request)
{
//Input received from the request
$input = $request->except(['_token']);
//Create the model using repository create method
$this->repository->create($input);
//return with successfull message
return redirect()->route('admin.dummy_small_plural_model.index')->withFlashSuccess(trans('alerts.backend.dummy_small_plural_model.created'));
}
@endCreate@startEdit/**
* Show the form for editing the specified resource.
*
* @param DummyModelNamespace $DummyArgumentName
* @param DummyEditRequestNamespace $request
* @return \Illuminate\Http\Response
*/
public function edit(DummyModel $DummyArgumentName, DummyEditRequest $request)
{
return view('backend.dummy_small_plural_model.edit', compact('DummyArgumentName'));
}
/**
* Update the specified resource in storage.
*
* @param DummyUpdateRequestNamespace $request
* @param DummyModelNamespace $DummyArgumentName
* @return \Illuminate\Http\Response
*/
public function update(DummyUpdateRequest $request, DummyModel $DummyArgumentName)
{
//Input received from the request
$input = $request->except(['_token']);
//Update the model using repository update method
$this->repository->update( $DummyArgumentName, $input );
//return with successfull message
return redirect()->route('admin.dummy_small_plural_model.index')->withFlashSuccess(trans('alerts.backend.dummy_small_plural_model.updated'));
}
@endEdit@startDelete/**
* Remove the specified resource from storage.
*
* @param DummyDeleteRequestNamespace $request
* @param DummyModelNamespace $DummyArgumentName
* @return \Illuminate\Http\Response
*/
public function destroy(DummyModel $DummyArgumentName, DummyDeleteRequest $request)
{
//Calling the delete method on repository
$this->repository->delete($DummyArgumentName);
//returning with successfull message
return redirect()->route('admin.dummy_small_plural_model.index')->withFlashSuccess(trans('alerts.backend.dummy_small_plural_model.deleted'));
}
@endDelete
}
<?php
namespace DummyNamespace;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use DummyAttribute;
use DummyRelationship;
class DummyModel extends Model
{
use ModelTrait,
AttributeName,
RelationshipName {
// AttributeName::getEditButtonAttribute insteadof ModelTrait;
}
/**
* NOTE : If you want to implement Soft Deletes in this model,
* then follow the steps here : https://laravel.com/docs/5.4/eloquent#soft-deleting
*/
/**
* The database table used by the model.
* @var string
*/
protected $table = 'table_name';
/**
* Mass Assignable fields of model
* @var array
*/
protected $fillable = [
];
/**
* Default values for model fields
* @var array
*/
protected $attributes = [
];
/**
* Dates
* @var array
*/
protected $dates = [
'created_at',
'updated_at'
];
/**
* Guarded fields of model
* @var array
*/
protected $guarded = [
'id'
];
/**
* Constructor of Model
* @param array $attributes
*/
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
}
}
<?php
namespace RelationshipNamespace;
/**
* Class RelationshipClass
*/
trait RelationshipClass
{
/*
* put you model relationships here
* Take below example for reference
*/
/*
public function users() {
//Note that the below will only work if user is represented as user_id in your table
//otherwise you have to provide the column name as a parameter
//see the documentation here : https://laravel.com/docs/5.4/eloquent-relationships
$this->belongsTo(User::class);
}
*/
}
<?php
namespace DummyNamespace;
use DB;
use Carbon\Carbon;
use DummyModelNamespace;
use App\Exceptions\GeneralException;
use App\Repositories\BaseRepository;
use Illuminate\Database\Eloquent\Model;
/**
* Class DummyRepoName.
*/
class DummyRepoName extends BaseRepository
{
/**
* Associated Repository Model.
*/
const MODEL = dummy_model_name::class;
/**
* This method is used by Table Controller
* For getting the table data to show in
* the grid
* @return mixed
*/
public function getForDataTable()
{
return $this->query()
->select([
config('module.model_small_plural.table').'.id',
config('module.model_small_plural.table').'.created_at',
config('module.model_small_plural.table').'.updated_at',
]);
}
@startCreate
/**
* For Creating the respective model in storage
*
* @param array $input
* @throws GeneralException
* @return bool
*/
public function create(array $input)
{
$dummy_small_model_name = self::MODEL;
$dummy_small_model_name = new $dummy_small_model_name();
if ($dummy_small_model_name->save($input)) {
return true;
}
throw new GeneralException(trans('exceptions.backend.dummy_small_plural_model_name.create_error'));
}
@endCreate@startEdit
/**
* For updating the respective Model in storage
*
* @param dummy_model_name $dummy_small_model_name
* @param $input
* @throws GeneralException
* return bool
*/
public function update(dummy_model_name $dummy_small_model_name, array $input)
{
if ($dummy_small_model_name->update($input))
return true;
throw new GeneralException(trans('exceptions.backend.dummy_small_plural_model_name.update_error'));
}
@endEdit@startDelete
/**
* For deleting the respective model from storage
*
* @param dummy_model_name $dummy_small_model_name
* @throws GeneralException
* @return bool
*/
public function delete(dummy_model_name $dummy_small_model_name)
{
if ($dummy_small_model_name->delete()) {
return true;
}
throw new GeneralException(trans('exceptions.backend.dummy_small_plural_model_name.delete_error'));
}@endDelete
}
<?php
namespace DummyNamespace;
use Illuminate\Foundation\Http\FormRequest;
class DummyClass extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return access()->allow('permission');
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//Put your rules for the request in here
//For Example : 'title' => 'required'
//Further, see the documentation : https://laravel.com/docs/5.4/validation#creating-form-requests
];
}
public function messages()
{
return [
//The Custom messages would go in here
//For Example : 'title.required' => 'You need to fill in the title field.'
//Further, see the documentation : https://laravel.com/docs/5.4/validation#customizing-the-error-messages
];
}
}
<?php
namespace DummyNamespace;
use Carbon\Carbon;
use App\Http\Controllers\Controller;
use Yajra\DataTables\Facades\DataTables;
use DummyRepositoryNamespace;
use DummyManageRequestNamespace;
/**
* Class DummyTableController.
*/
class DummyTableController extends Controller
{
/**
* variable to store the repository object
* @var dummy_repository
*/
protected $dummy_small_repo_name;
/**
* contructor to initialize repository object
* @param dummy_repository $dummy_small_repo_name;
*/
public function __construct(dummy_repository $dummy_small_repo_name)
{
$this->dummy_small_repo_name = $dummy_small_repo_name;
}
/**
* This method return the data of the model
* @param dummy_manage_request_name $request
*
* @return mixed
*/
public function __invoke(dummy_manage_request_name $request)
{
return Datatables::of($this->dummy_small_repo_name->getForDataTable())
->escapeColumns(['id'])
->addColumn('created_at', function ($dummy_small_repo_name) {
return Carbon::parse($dummy_small_repo_name->created_at)->toDateString();
})
->addColumn('actions', function ($dummy_small_repo_name) {
return $dummy_small_repo_name->action_buttons;
})
->make(true);
}
}
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.dummy_small_plural_model.management') . ' | ' . trans('labels.backend.dummy_small_plural_model.create'))
@section('page-header')
<h1>
{{ trans('labels.backend.dummy_small_plural_model.management') }}
<small>{{ trans('labels.backend.dummy_small_plural_model.create') }}</small>
</h1>
@endsection
@section('content')
{{ Form::open(['route' => 'admin.dummy_small_plural_model.store', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'id' => 'create-dummy_small_model']) }}
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.dummy_small_plural_model.create') }}</h3>
<div class="box-tools pull-right">
@include('backend.dummy_small_plural_model.partials.dummy_small_plural_model-header-buttons')
</div><!--box-tools pull-right-->
</div><!--box-header with-border-->
<div class="box-body">
<div class="form-group">
{{-- Including Form blade file --}}
@include("backend.dummy_small_plural_model.form")
<div class="edit-form-btn">
{{ link_to_route('admin.dummy_small_plural_model.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.create'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div><!--edit-form-btn-->
</div><!-- form-group -->
</div><!--box-body-->
</div><!--box box-success-->
{{ Form::close() }}
@endsection
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.dummy_small_plural_model.management') . ' | ' . trans('labels.backend.dummy_small_plural_model.edit'))
@section('page-header')
<h1>
{{ trans('labels.backend.dummy_small_plural_model.management') }}
<small>{{ trans('labels.backend.dummy_small_plural_model.edit') }}</small>
</h1>
@endsection
@section('content')
{{ Form::model($dummy_small_model, ['route' => ['admin.dummy_small_plural_model.update', $dummy_small_model], 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'PATCH', 'id' => 'edit-dummy_small_model']) }}
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.dummy_small_plural_model.edit') }}</h3>
<div class="box-tools pull-right">
@include('backend.dummy_small_plural_model.partials.dummy_small_plural_model-header-buttons')
</div><!--box-tools pull-right-->
</div><!--box-header with-border-->
<div class="box-body">
<div class="form-group">
{{-- Including Form blade file --}}
@include("backend.dummy_small_plural_model.form")
<div class="edit-form-btn">
{{ link_to_route('admin.dummy_small_plural_model.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.update'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div><!--edit-form-btn-->
</div><!--form-group-->
</div><!--box-body-->
</div><!--box box-success -->
{{ Form::close() }}
@endsection
<div class="box-body">
<div class="form-group">
<!-- Create Your Field Label Here -->
<!-- Look Below Example for reference -->
{{-- {{ Form::label('name', trans('labels.backend.blogs.title'), ['class' => 'col-lg-2 control-label required']) }} --}}
<div class="col-lg-10">
<!-- Create Your Input Field Here -->
<!-- Look Below Example for reference -->
{{-- {{ Form::text('name', null, ['class' => 'form-control box-size', 'placeholder' => trans('labels.backend.blogs.title'), 'required' => 'required']) }} --}}
</div><!--col-lg-10-->
</div><!--form-group-->
</div><!--box-body-->
@section("after-scripts")
<script type="text/javascript">
//Put your javascript needs in here.
//Don't forget to put `@`parent exactly after `@`section("after-scripts"),
//if your create or edit blade contains javascript of its own
$( document ).ready( function() {
//Everything in here would execute after the DOM is ready to manipulated.
});
</script>
@endsection
<!--Action Button-->
@if( Active::checkUriPattern( 'admin/dummy_small_plural_model' ) )
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
@endif
<!--Action Button-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-flat dropdown-toggle" data-toggle="dropdown">Action
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="{{ route( 'admin.dummy_small_plural_model.index' ) }}">
<i class="fa fa-list-ul"></i> {{ trans( 'menus.backend.dummy_small_plural_model.all' ) }}
</a>
</li>
@create@permission( 'create-dummy_small_model' )
<li>
<a href="{{ route( 'admin.dummy_small_plural_model.create' ) }}">
<i class="fa fa-plus"></i> {{ trans( 'menus.backend.dummy_small_plural_model.create' ) }}
</a>
</li>
@endauth@endCreate
</ul>
</div>
<div class="clearfix"></div>
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.dummy_small_plural_model.management'))
@section('page-header')
<h1>{{ trans('labels.backend.dummy_small_plural_model.management') }}</h1>
@endsection
@section('content')
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.dummy_small_plural_model.management') }}</h3>
<div class="box-tools pull-right">
@include('backend.dummy_small_plural_model.partials.dummy_small_plural_model-header-buttons')
</div>
</div><!--box-header with-border-->
<div class="box-body">
<div class="table-responsive data-table-wrapper">
<table id="dummy_small_plural_model-table" class="table table-condensed table-hover table-bordered">
<thead>
<tr>
<th>{{ trans('labels.backend.dummy_small_plural_model.table.id') }}</th>
<th>{{ trans('labels.backend.dummy_small_plural_model.table.createdat') }}</th>
<th>{{ trans('labels.general.actions') }}</th>
</tr>
</thead>
<thead class="transparent-bg">
<tr>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
</table>
</div><!--table-responsive-->
</div><!-- /.box-body -->
</div><!--box-->
@endsection
@section('after-scripts')
{{-- For DataTables --}}
{{ Html::script(mix('js/dataTable.js')) }}
<script>
//Below written line is short form of writing $(document).ready(function() { })
$(function() {
var dataTable = $('#dummy_small_plural_model-table').dataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("admin.dummy_small_plural_model.get") }}',
type: 'post'
},
columns: [
{data: 'id', name: '{{config('module.dummy_small_plural_model.table')}}.id'},
{data: 'created_at', name: '{{config('module.dummy_small_plural_model.table')}}.created_at'},
{data: 'actions', name: 'actions', searchable: false, sortable: false}
],
order: [[0, "asc"]],
searchDelay: 500,
dom: 'lBfrtip',
buttons: {
buttons: [
{ extend: 'copy', className: 'copyButton', exportOptions: {columns: [ 0, 1 ] }},
{ extend: 'csv', className: 'csvButton', exportOptions: {columns: [ 0, 1 ] }},
{ extend: 'excel', className: 'excelButton', exportOptions: {columns: [ 0, 1 ] }},
{ extend: 'pdf', className: 'pdfButton', exportOptions: {columns: [ 0, 1 ] }},
{ extend: 'print', className: 'printButton', exportOptions: {columns: [ 0, 1 ] }}
]
}
});
FinBuilders.DataTableSearch.init(dataTable);
});
</script>
@endsection
<?php
/**
* DummyModuleName
*
*/
Route::group(['namespace' => 'route_namespace', 'prefix' => 'admin', 'as' => 'admin.', 'middleware' => 'admin'], function () {
@startNamespace
Route::group( ['namespace' => 'DummyModel'], function () {
Route::resource('dummy_name', 'DummyController');
//For Datatable
Route::post('dummy_name/get', 'DummyTableController')->name('dummy_name.get');
});
@endNamespace@startWithoutNamespace
Route::resource('dummy_name', 'DummyController');
//For Datatable
Route::post('dummy_name/get', 'DummyTableController')->name('dummy_name.get');
@endWithoutNamespace
});
\ No newline at end of file
<?php
/**
* Routes for : DummyModuleName
*/
Route::group(['namespace' => 'route_namespace', 'prefix' => 'admin', 'as' => 'admin.', 'middleware' => 'admin'], function () {
@startNamespace
Route::group( ['namespace' => 'DummyModel'], function () {
Route::get('dummy_name', 'DummyController@index')->name('dummy_name.index');
@startCreateRoute::get('dummy_name/create', 'DummyController@create')->name('dummy_name.create');
Route::post('dummy_name', 'DummyController@store')->name('dummy_name.store');@endCreate
@startEditRoute::get('dummy_name/{dummy_argument_name}/edit', 'DummyController@edit')->name('dummy_name.edit');
Route::patch('dummy_name/{dummy_argument_name}', 'DummyController@update')->name('dummy_name.update');@endEdit
@startDeleteRoute::delete('dummy_name/{dummy_argument_name}', 'DummyController@destroy')->name('dummy_name.destroy');@endDelete
//For Datatable
Route::post('dummy_name/get', 'DummyTableController')->name('dummy_name.get');
});
@endNamespace@startWithoutNamespace
Route::get('dummy_name', 'DummyController@index')->name('dummy_name.index');
@startCreateRoute::get('dummy_name/create', 'DummyController@create')->name('dummy_name.create');
Route::post('dummy_name', 'DummyController@store')->name('dummy_name.store');@endCreate
@startEditRoute::get('dummy_name/{dummy_argument_name}/edit', 'DummyController@edit')->name('dummy_name.edit');
Route::patch('dummy_name/{dummy_argument_name}', 'DummyController@update')->name('dummy_name.update');@endEdit
@startDeleteRoute::delete('dummy_name/{dummy_argument_name}', 'DummyController@destroy')->name('dummy_name.destroy');@endDelete
//For Datatable
Route::post('dummy_name/get', 'DummyTableController')->name('dummy_name.get');
@endWithoutNamespace
});
\ No newline at end of file
@extends ('backend.layouts.app')
@section ('title', trans('generator::labels.modules.management') . ' | ' . trans('generator::labels.modules.create'))
@section('page-header')
<h1>
{{ trans('generator::labels.modules.management') }}
<small>{{ trans('generator::labels.modules.create') }}</small>
</h1>
@endsection
@section('content')
{{ Form::open(['route' => 'admin.modules.store', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'post', 'id' => 'create-module', 'files' => true]) }}
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('generator::labels.modules.create') }}</h3>
<div class="box-tools pull-right">
@include('generator::partials.modules-header-buttons')
</div><!--box-tools pull-right-->
</div><!-- /.box-header -->
{{-- Including Form blade file --}}
<div class="box-body">
<div class="form-group">
@include("generator::form")
<div class="edit-form-btn">
{{ link_to_route('admin.modules.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.create'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div>
</div>
</div><!--box-->
</div>
{{ Form::close() }}
@endsection
@extends ('backend.layouts.app')
@section ('title', trans('generator::labels.modules.management') . ' | ' . trans('generator::labels.modules.edit'))
@section('page-header')
<h1>
{{ trans('generator::labels.modules.management') }}
<small>{{ trans('generator::labels.modules.edit') }}</small>
</h1>
@endsection
@section('content')
{{ Form::model($module, ['route' => ['admin.modules.update', $module], 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'PATCH', 'id' => 'edit-module', 'files' => true]) }}
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('generator::labels.modules.edit') }}</h3>
<div class="box-tools pull-right">
@include('generator::partials.modules-header-buttons')
</div><!--box-tools pull-right-->
</div><!-- /.box-header -->
{{-- Including Form blade file --}}
<div class="box-body">
<div class="form-group">
@include("backend.modules.form")
<div class="edit-form-btn">
{{ link_to_route('admin.modules.index', trans('buttons.general.cancel'), [], ['class' => 'btn btn-danger btn-md']) }}
{{ Form::submit(trans('buttons.general.crud.update'), ['class' => 'btn btn-primary btn-md']) }}
<div class="clearfix"></div>
</div>
</div>
</div><!--box-->
</div>
{{ Form::close() }}
@endsection
\ No newline at end of file
This diff is collapsed.
@extends ('backend.layouts.app')
@section ('title', trans('labels.backend.modules.management'))
@section('page-header')
<h1>{{ trans('labels.backend.modules.management') }}</h1>
@endsection
@section('content')
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('labels.backend.modules.management') }}</h3>
<div class="box-tools pull-right">
@include('generator::partials.modules-header-buttons')
</div>
</div><!-- /.box-header -->
<div class="box-body">
<div class="table-responsive data-table-wrapper">
<table id="modules-table" class="table table-condensed table-hover table-bordered">
<thead>
<tr>
<th>{{ trans('labels.backend.modules.table.name') }}</th>
<th>{{ trans('labels.backend.modules.table.view_permission_id') }}</th>
<th>{{ trans('labels.backend.modules.table.url') }}</th>
<th>{{ trans('labels.backend.modules.table.created_by') }}</th>
</tr>
</thead>
<thead class="transparent-bg">
<tr>
<th>
{!! Form::text('name', null, ["class" => "search-input-text form-control", "data-column" => 0, "placeholder" => trans('labels.backend.modules.table.name')]) !!}
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
</th>
<th>
{!! Form::text('permission', null, ["class" => "search-input-text form-control", "data-column" => 1, "placeholder" => trans('labels.backend.modules.table.view_permission_id')]) !!}
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
</th>
<th>
{!! Form::text('route', null, ["class" => "search-input-text form-control", "data-column" => 2, "placeholder" => trans('labels.backend.modules.table.url')]) !!}
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
</th>
<th>
{!! Form::text('created_by', null, ["class" => "search-input-text form-control", "data-column" => 3, "placeholder" => trans('labels.backend.modules.table.created_by')]) !!}
<a class="reset-data" href="javascript:void(0)"><i class="fa fa-times"></i></a>
</th>
</tr>
</thead>
</table>
</div><!--table-responsive-->
</div><!-- /.box-body -->
</div><!--box-->
<!--<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('history.backend.recent_history') }}</h3>
<div class="box-tools pull-right">
<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
</div><!-- /.box tools -->
</div><!-- /.box-header -->
<div class="box-body">
{{-- {!! history()->renderType('Blog') !!} --}}
</div><!-- /.box-body -->
</div><!--box box-success-->
@endsection
@section('after-scripts')
{{-- For DataTables --}}
{{ Html::script(mix('js/dataTable.js')) }}
<script>
$(function() {
var dataTable = $('#modules-table').dataTable({
processing: true,
serverSide: true,
ajax: {
url: '{{ route("admin.modules.get") }}',
type: 'post'
},
columns: [
{data: 'name', name: '{{config('module.table')}}.name'},
{data: 'view_permission_id', name: '{{config('module.table')}}.view_permission_id'},
{data: 'url', name: '{{config('module.table')}}.url'},
{data: 'created_by', name: '{{config('access.users_table')}}.first_name'}
],
order: [[0, "asc"]],
searchDelay: 500,
dom: 'lBfrtip',
buttons: {
buttons: [
{ extend: 'copy', className: 'copyButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
{ extend: 'csv', className: 'csvButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
{ extend: 'excel', className: 'excelButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
{ extend: 'pdf', className: 'pdfButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }},
{ extend: 'print', className: 'printButton', exportOptions: {columns: [ 0, 1, 2, 3 ] }}
]
}
});
Backend.DataTableSearch.init(dataTable);
});
</script>
@endsection
<!--Action Button-->
@if(Active::checkUriPattern('admin/modules'))
<div class="btn-group">
<button type="button" class="btn btn-warning btn-flat dropdown-toggle" data-toggle="dropdown">Export
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li id="copyButton"><a href="#"><i class="fa fa-clone"></i> Copy</a></li>
<li id="csvButton"><a href="#"><i class="fa fa-file-text-o"></i> CSV</a></li>
<li id="excelButton"><a href="#"><i class="fa fa-file-excel-o"></i> Excel</a></li>
<li id="pdfButton"><a href="#"><i class="fa fa-file-pdf-o"></i> PDF</a></li>
<li id="printButton"><a href="#"><i class="fa fa-print"></i> Print</a></li>
</ul>
</div>
@endif
<!--Action Button-->
<div class="btn-group">
<button type="button" class="btn btn-primary btn-flat dropdown-toggle" data-toggle="dropdown">Action
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{route('admin.modules.index')}}"><i class="fa fa-list-ul"></i> {{trans('menus.backend.modules.all')}}</a></li>
<li><a href="{{route('admin.modules.create')}}"><i class="fa fa-plus"></i> {{trans('menus.backend.modules.create')}}</a></li>
</ul>
</div>
<div class="clearfix"></div>
\ No newline at end of file
......@@ -100,6 +100,17 @@ class ManageBlogsTest extends TestCase
->assertSessionHasErrors('featured_image');
}
/** @test */
public function it_requires_publish_datetime_while_creating()
{
$blog = $this->makeBlog();
unset($blog->publish_datetime);
$this->post(route('admin.blogs.store'), $blog->toArray())
->assertSessionHasErrors('publish_datetime');
}
/** @test */
public function it_requires_categories_while_creating()
{
......@@ -156,6 +167,17 @@ class ManageBlogsTest extends TestCase
->assertSessionHasErrors('content');
}
/** @test */
public function it_requires_publish_datetime_while_updating()
{
$this->withExceptionHandling();
unset($this->blog->publish_datetime);
$this->patch(route('admin.blogs.update', $this->blog), $this->blog->toArray())
->assertSessionHasErrors('publish_datetime');
}
/** @test */
public function it_requires_categories_while_updating()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment