Yab\Quarx\Repositories\LinkRepository::findLinksById PHP Method

findLinksById() public method

Find Links by given id.
public findLinksById ( integer $id ) : Collection | null | static | Links
$id integer
return Illuminate\Support\Collection | null | static | Links
    public function findLinksById($id)
    {
        return Link::find($id);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Remove the specified Links from storage.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $links = $this->linksRepository->findLinksById($id);
     $menu = $links->menu_id;
     if (empty($links)) {
         Quarx::notification('Link not found', 'warning');
         return redirect(route('quarx.links.index'));
     }
     $links->delete();
     Quarx::notification('Link deleted successfully.', 'success');
     return redirect(URL::to('quarx/menus/' . $menu . '/edit'));
 }