mirror of
https://repo.getmonero.org/AnonDev/xmrmemes.git
synced 2025-05-04 16:15:03 -04:00
Almost complete site
Add dark / light theme Add social sharing on meme pages Add approving / pending admin section Improve design Add pagination on profiles Make front end date time user friendly Finish rough draft of site And Much more... Still need to fix a few minor things before it goes live. Almost complete.
This commit is contained in:
parent
52a9007882
commit
dbfda5cf9e
39 changed files with 54195 additions and 663 deletions
|
@ -71,6 +71,11 @@ class MemeController extends Controller
|
|||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validatedData = $request->validate([
|
||||
'title' => ['required', 'string', 'max:255'],
|
||||
'caption' => ['string', 'max:255', 'nullable'],
|
||||
'image' => ['required', 'image'],
|
||||
]);
|
||||
$user = \Auth::user();
|
||||
$used_ids = Meme::pluck('address_id')->toArray();
|
||||
$address = Address::whereNotIn('id', $used_ids)->first('id');
|
||||
|
@ -78,7 +83,7 @@ class MemeController extends Controller
|
|||
'user_id' => $user->id,
|
||||
'address_id' => $address->id,
|
||||
'title' => $request->input('title'),
|
||||
// 'caption' => $request->input('caption'),
|
||||
'caption' => $request->input('caption'),
|
||||
'image' => $request->file('image'),
|
||||
]);
|
||||
}
|
||||
|
@ -133,14 +138,27 @@ class MemeController extends Controller
|
|||
//
|
||||
}
|
||||
|
||||
public function approve($id)
|
||||
{
|
||||
if (\Auth::user()->is_admin === 1) {
|
||||
$meme = Meme::withoutGlobalScope('approved')->find($id);
|
||||
$meme->is_approved = 1;
|
||||
$meme->save();
|
||||
return redirect()->away(url()->previous());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Meme $meme
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Meme $meme)
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
if (\Auth::user()->is_admin === 1) {
|
||||
Meme::withoutGlobalScope('approved')->where('id', $id)->delete();
|
||||
return redirect()->away(url()->previous());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue