Commit eb765d5f authored by gvk2800's avatar gvk2800
Browse files

init

parent 103d93ea
No related merge requests found
Pipeline #307 failed with stages
in 0 seconds

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:FgY3wu/FkTU1cwodiFqI9fykJ8FtH9u4jcWQDO5mego=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=blogg
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
php:
preset: laravel
disabled:
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Exception $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ApiController extends Controller
{
//
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/
use ConfirmsPasswords;
/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
}
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}
<?php
namespace App\Http\Controllers;
use App\categories;
use Illuminate\Http\Request;
use Session;
class BlogCategoryController extends Controller
{
//
public function vv()
{
return "Hiiiiiii";
}
public function form()
{
return view('category/form');
}
public function cstore(Request $r)
{
$r->validate([
'name'=>'required|min:5|unique:categories,Category_Name',
'description'=>'required|min:5'
]);
$newc= new categories;
$newc->Category_Name=$r->name;
$newc->Category_Description=$r->description;
$newc->slug=str_replace(" ","-",$r->name);
$newc->save();
Session::flash('sucess','Category Saved Sucessfully');
return redirect()->route('abd');
// dd($newc);
// dd($r);
}
public function index(){
// $ud=categories::get();
$d=categories::with('blogs')->paginate(4);
// dd($d);
return view('category/alldet',compact('d'));
}
public function cedit(categories $id=null)
{
// dd($id);
return view('category/cedit',compact('id'));
}
public function cshow($id=null)
{
$data=categories::where('slug',$id)->first();
// dd($data);
return $data;
}
public function cupdate(Request $req)
{
$req->validate([
'name'=>'required|min:5|unique:categories,Category_Name,'.$req->id,
'description'=>'required|min:5'
]);
// dd($req);
// $d=categories::find($req->id);
$d=categories::where('slug',$id)->first();
// $d->id=$req->idd;
// dd($d);
$d->Category_Name=$req->name;
$d->Category_Description=$req->description;
$d->slug=str_replace(" ","-",$r->Category_Name);
// dd($d);
$d->save();
return redirect()->route('abd');
}
public function cdel(Request $r)
{
$obj=categories::where('id',$r->id)->delete();
return redirect()->back();
// dd($r);
}
public function ctrash()
{
$d=categories::onlyTrashed()->get();
// $d=DB::table('categories')->whereNotNull('deleted_at')->get();
// $d=DB::select("select * from categories where deleted_at != null");
return view('category/trashdet',compact('d'));
}
public function restoreData(Request $request){
$cat = categories::onlyTrashed()->find($request->id);
$cat->restore();
$d=categories::onlyTrashed()->get();
return view('category/trashdet', compact('d'));
}
public function perDelete(Request $request){
$cat = categories::withTrashed()->find($request->id);
if($cat->deleted_at){
$cat->forceDelete();
}
$d=categories::onlyTrashed()->get();
return view('category/trashdet', compact('d'));
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\blog;
use App\categories;
use App\tag;
use App\Traits\CommonTraits;
class BlogController extends Controller
{
//
use CommonTraits;
public function index()
{
$cat=categories::get();
$blog=blog::with('category')->paginate(10);
$tags=tag::all();
// dd($blog);
return view('Blog.index',compact('blog','cat','tags'));
}
public function bstore(Request $re)
{
// dd($re);
$newblog=new blog;
$newblog->title=$re->title;
$newblog->content=$re->content;
$newblog->category_id=$re->category;
if($re->file('blog_image'))
{
$path="blog";
$filename=str_replace(" ","",$re->title);
$sp=$this->saveFiles($re->file('blog_image'),$path,$filename);
// dd($sp);
$newblog->file_path=$sp;
}
$newblog->save();
$newblog->tags()->sync($re->tag);
session()->flash('success','Blog Saved Successufully');
return redirect()->back();
}
public function bupdate(Request $re)
{
// dd($re);
$editBlog=blog::where('id',$re->id)->first();
$editBlog->title=$re->title;
$editBlog->content=$re->content;
$editBlog->category_id=$re->category;
$editBlog->save();
session()->flash('warning','Blog Updated Succesfully');
return redirect()->route('blog.index');
}
public function bdel(Request $r)
{
$blog=blog::where('id',$r->blog_id)->first();
if($blog->deleted_at)
{
$blog->forceDelete();
}
else
{
$blog->delete();
}
return response()->json(['status'=>'success','message'=>'Blog deleted successfully']);
}
}
<?php
namespace App\Http\Controllers;
use App\tag;
use Illuminate\Http\Request;
use Session;
class BlogTagController extends Controller
{
//
public function aform()
{
return view('/tag/aform');
}
public function astore(Request $r)
{
$newc= new tag;
// dd($r);
$newc->Tag_Name=$r->name;
$newc->Tag_Description=$r->description;
$newc->save();
Session::flash('sucess','Tag Details Saved Sucessfully');
return redirect()->route('ain');
// dd($newc);
// dd($r);
}
public function ashow($id)
{
$data=tag::where('id',$id)->first();
// dd($data);
return $data;
}
public function aindex(){
// $ud=categories::get();
$ud=tag::with('blogs')->paginate(4);
return view('tag/alltag',compact('ud'));
}
public function aedit(Request $r)
{
// dd($r);
$id=tag::find($r->id);
return view('tag/aedit',compact('id'));
}
public function aupdate(Request $req)
{
// dd($req);
$d=tag::find($req->id);
// $d->id=$req->idd;
// dd($d);
$d->Tag_Name=$req->name;
$d->Tag_Description=$req->description;
// dd($d);
$d->save();
return redirect()->route('ain');
}
public function adel(Request $r)
{
$obj=tag::where('id',$r->id)->delete();
return redirect()->back();
// dd($r);
}
}
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('home_new');
}
}
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