404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.142.131.51: ~ $
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;

class FaceBookLinkController extends Controller
{
    protected $database;

    public function __construct()
    {
        $this->database = app('firebase.database');
    }
    public function index(){
        return view('admin.facebook_links.all');
    }  public function add(){
        return view('admin.facebook_links.add');
    }

    public function create(){

    }
    public function store(Request $request)
    {
        $validateArray = [
            'link' => 'required|url|regex:/http(?:s):\/\/(?:www\.)facebook\.com\/.+/i',
        ];

        //validate
        $validator = Validator::make($request->all(), $validateArray, []);

        if ($validator->fails()) {
            return error_api_processor('Some fields seems not correct!', 200, validation_error_processor($validator));
        }
        try {
            $reference = $this->database->getReference('facebook_link');

            $key = $reference->set([
                $request->link
            ])->getKey();
            return success_api_processor($key, 'Link created successfully.');
        } catch (Exception $e) {
            return error_api_processor('Something went wrong! Please try again later.', 200, $e);
        }
    }

    /**
     * @param $key
     * @return JsonResponse
     */
    public function remove($key): JsonResponse
    {
        $reference = $this->database->getReference('facebook_link');
        $reference = $reference->getChild($key);
        $reference->remove();

        return success_api_processor($reference, 'Success');
    }
}

Filemanager

Name Type Size Permission Actions
Auth Folder 0755
DashboardController.php File 1.08 KB 0644
FaceBookLinkController.php File 1.75 KB 0644
NewsPodcastsController.php File 7.1 KB 0644
ScheduleController.php File 4.07 KB 0644
UploadImagesController.php File 3.64 KB 0644
UsersController.php File 6.22 KB 0644