-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a84cede
commit c0a82e1
Showing
22 changed files
with
13,363 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
use App\Karya as Karya; | ||
use Illuminate\Http\Request; | ||
use Auth; | ||
use Carbon\Carbon as Carbon; | ||
|
||
class KaryaController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
$karya = Karya::all(); | ||
return $karya; | ||
} | ||
|
||
public function show($id) | ||
{ | ||
$karya = Karya::find($id); | ||
return view('karya.view', ['karya' => $karya]); | ||
} | ||
|
||
public function postCreate(Request $request) | ||
{ | ||
$karya = new Karya(); | ||
$karya->nama = $request->input('judul'); | ||
$karya->deskripsi = $request->input('deskripsi'); | ||
if (($request->hasFile('thumbs'))) { | ||
$filename = "karya-".Carbon::now()->format('YmdHis') .'.jpg'; | ||
$path = $request->file('thumbs')->storeAs('public', $filename); | ||
$karya->img_thumb = "storage/" . $filename; | ||
} else { | ||
$karya->img_thumb = 'default.jpg'; | ||
} | ||
$karya->user_id = Auth::user()->id; | ||
$karya->save(); | ||
|
||
return redirect()->route('karya', ['id' => $karya->id]); | ||
} | ||
|
||
public function createView() | ||
{ | ||
return view('karya.create'); | ||
} | ||
public function edit($id) | ||
{ | ||
|
||
} | ||
public function postEdit($id) | ||
{ | ||
|
||
} | ||
public function delete($id) | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class Karya extends Model | ||
{ | ||
protected $table = "karya"; | ||
|
||
public function user() { | ||
return $this->belongsTo('App\User', 'user_id'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
body { | ||
background-color: #e6e6e6; | ||
} | ||
.karya-card { | ||
margin-bottom :10px; | ||
} | ||
.karya-card .thumbs { | ||
overflow: hidden; | ||
display: block; | ||
height: 210px; | ||
text-align: center; | ||
} | ||
|
||
.karya-card .thumbs img { | ||
height: 210px; | ||
/*max-width: 100%;*/ | ||
} | ||
|
||
.karya-card .thumbs:hover { | ||
background-position: center; | ||
} | ||
|
||
.karya-thumb { | ||
margin-bottom: 10px; | ||
} | ||
.karya-thumb .footer { | ||
padding: 10px; | ||
} | ||
|
||
.karya-thumb .footer .profil { | ||
height: 25px; | ||
width: 25px; | ||
} | ||
|
||
.karya-thumb .title { | ||
display: block; | ||
width: 100%; | ||
position: absolute; | ||
bottom: 0px; | ||
left: 0px; | ||
padding: 10px; | ||
margin: 0px; | ||
color: #fff; | ||
text-decoration: none; | ||
font-size: 11pt; | ||
font-weight: normal; | ||
|
||
background: rgba(255,255,255,0); | ||
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.67) 63%); | ||
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(255,255,255,0)), color-stop(45%, rgba(0,0,0,0.48)), color-stop(63%, rgba(0,0,0,0.67))); | ||
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.67) 63%); | ||
background: -o-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.67) 63%); | ||
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.67) 63%); | ||
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(0,0,0,0.48) 45%, rgba(0,0,0,0.67) 63%); | ||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#000000', GradientType=0 ); | ||
} | ||
|
||
.img-profile { | ||
width: 30px; | ||
height: 30px; | ||
margin-right: 5px; | ||
} |
Oops, something went wrong.