src/Http/Controllers/PageAPIController.php
public function store(PageRequest $request)
    {
        try {
            $data              = $request->all();
            $data['user_id']   = user_id();
            $data['user_type'] = user_type();
            $data              = $this->repository->create($data);
            $message           = trans('messages.success.created', ['Module' => trans('page::page.name')]);
            $code              = 204;
            $status            = 'success';
            $url               = guard_url('page/page/' . $page->getRouteKey());
        } catch (Exception $e) {
            $message = $e->getMessage();
            $code    = 400;
            $status  = 'error';
            $url     = guard_url('page/page');
        }
        return compact('data', 'message', 'code', 'status', 'url');
    }
public function store(PageRequest $request)
    {
        try {
            $data              = $request->all();
            $data['user_id']   = user_id();
            $data['user_type'] = user_type();
            $data              = $this->repository->create($data);
            $message           = trans('messages.success.created', ['Module' => trans('page::page.name')]);
            $code              = 204;
            $status            = 'success';
            $url               = guard_url('page/page/' . $page->getRouteKey());
        } catch (Exception $e) {
            $message = $e->getMessage();
            $code    = 400;
            $status  = 'error';
            $url     = guard_url('page/page');
        }
        return compact('data', 'message', 'code', 'status', 'url');
    }
public function store ( PageRequest $ request ) { try { $ data = $ request -> all ( ) ; $ data [ 'user_id' ] = user_id ( ) ; $ data [ 'user_type' ] = user_type ( ) ; $ data = $ this -> repository -> create ( $ data ) ; $ message = trans ( 'messages.success.created' , [ 'Module' => trans ( 'page::page.name' ) ] ) ; $ code = 204 ; $ status = 'success' ; $ url = guard_url ( 'page/page/' . $ page -> getRouteKey ( ) ) ; } catch ( Exception $ e ) { $ message = $ e -> getMessage ( ) ; $ code = 400 ; $ status = 'error' ; $ url = guard_url ( 'page/page' ) ; } return compact ( 'data' , 'message' , 'code' , 'status' , 'url' ) ; }
Create new page.

@param Request $request

@return Response
Create new page .