Giter Club home page Giter Club logo

Comments (3)

ricardopaiva avatar ricardopaiva commented on August 14, 2024

Alejandri, you can see the changes suggested by idangozlan. Check the only pull request that's active.

from laravel-5-bootstrap-3-starter-site.

alejandri avatar alejandri commented on August 14, 2024

Thanks. I solved changed in HomeController this:

public function index()
{
$news = $this->news->orderBy('position', 'DESC')->orderBy('created_at', 'DESC')->limit(4)->get();
$sliders = Photo::join('photo_album', 'photo_album.id','=','photo.photo_album_id')
->where('photo.slider',1)
->orderBy('photo.position', 'DESC')
->orderBy('photo.created_at', 'DESC')
->select('photo.filename','photo.name','photo.description','photo_album.folderid')->get();

        $photoalbums = PhotoAlbum::select(array('photo_album.id', 'photo_album.name', 'photo_album.description',
                'photo_album.folderid',
                DB::raw('(select filename from photo WHERE album_cover=1 and photo.photo_album_id=photo_album.id) AS album_image'),
                DB::raw('(select filename from photo WHERE photo.photo_album_id=photo_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();

        $videoalbums = VideoAlbum::select(array('video_album.id', 'video_album.name', 'video_album.description',
                'video_album.folderid',
                DB::raw('(select youtube from video as v WHERE album_cover=1 and v.video_album_id=video_album.id) AS album_image'),
                DB::raw('(select youtube from video WHERE video.video_album_id=video_album.id ORDER BY position ASC, id ASC LIMIT 1) AS album_image_first')))->limit(8)->get();

        return view('site.home.index',compact('news','sliders','videoalbums','photoalbums'));
}

from laravel-5-bootstrap-3-starter-site.

stojankukrika avatar stojankukrika commented on August 14, 2024

TNX for help! 👍

from laravel-5-bootstrap-3-starter-site.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.