Skip to content

Commit

Permalink
.gitignore update
Browse files Browse the repository at this point in the history
  • Loading branch information
Priatmoko committed Apr 2, 2019
1 parent b88cafe commit d112bc9
Show file tree
Hide file tree
Showing 4,747 changed files with 576,976 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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]
indent_size = 2
42 changes: 42 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

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

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

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}"
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/node_modules
/public/hot
/public/files
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
composer.lock
42 changes: 42 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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');
}
}
51 changes: 51 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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
*/
public function report(Exception $exception)
{
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}
89 changes: 89 additions & 0 deletions app/Http/Controllers/Admin/Profile/FormController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php

namespace App\Http\Controllers\Admin\Profile;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use App\User;

class FormController extends Controller
{
/**
* Store the post data user profile
* @param void object laravel Request
* @return string json
*/
public function store(Request $r)
{
//validate the input
$validation =\Validator::make($r->all(), [
'name'=>'required|max:191',
'id'=>'required',
'username'=>'required',
'email'=>'required|email',
'avatar'=>'image|max:1024']);
//check validataion result
if ($validation->fails())
return response()->json(['errors'=>$validation->errors()], 422);

//check the existance of avatar upload
if ($r->has('avatar')){
$file = $r->file('avatar');
$filename = $r->input('username').'.'.$file->extension();
$path = public_path('files/admin/users/');
$this->moveFile($file, $filename, $path);
}
//passed input continue to run update operation
$user = User::find($r->input('id'));
$user->name = $r->input('name');
$user->email = $r->input('email');

if (isset($filename) && $filename!="")
$user->avatar = $filename;

if ($user->save()){

if (isset($filename) && $filename!=""){
$data['avatar']=$filename;
\Image::make($path.$filename)
->fit(200)
->save($path.'thumb-'.$filename);
$data['image']=$this->toBase64($path.'thumb-'.$filename);
}
$response =['status'=>'success',
'data'=>(isset($data)?$data:''),
'message'=>''];
return response()->json($response, 200);
}
return response()->json(['status'=>'error', 'message'=>''], 200);

}
/**
* Upload file attach
* @param mixed $file object file operation
* @param string $filename
* @return void
*/
private function moveFile($file, $filename, $path)
{
//validate upload file
if (isset($file) && $file->isValid()){

//check file existing
if (file_exists($path.$filename))
unlink($path.$filename);

//move the file to the server
$file->move($path, $filename);

}
}
private function toBase64($image_location) {
$image_path = $image_location;
$image_type = pathinfo($image_path, PATHINFO_EXTENSION);
$image_data = file_get_contents($image_path);
$image_base64 = 'data:image/' . $image_type . ';base64,' . base64_encode($image_data);
return $image_base64;
}
}
36 changes: 36 additions & 0 deletions app/Http/Controllers/Admin/Profile/IndexController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* Controller handle operation in user profile
* Priatmoko - [email protected]
* 2019 - 03 - 11
*/
namespace App\Http\Controllers\Admin\Profile;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class IndexController extends Controller
{
/**
* Display main panel of user profile
* @return void
*/
public function index()
{
$breadcrumb = ['User profile'=>''];
$title = 'User Profile';
return view('Admin.Profile.index')
->with('breadcrumb', $breadcrumb);
}
/**
* Displaying form user profile setting
* @return void
*/
public function setting()
{
$breadcrumb = ['User profile'=>route('profile'), 'Setting'=>''];
$title = 'Profile Setting';
return view('Admin.Profile.setting')
->with('breadcrumb', $breadcrumb);
}
}
32 changes: 32 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?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;

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
Loading

0 comments on commit d112bc9

Please sign in to comment.