How can I fetch data from database to multiple views in Laravel? - php

This might be a challenging topic, because I haven't found anything on Google or YouTube.
So I want to fetch data from a database to multiple views/pages in a Laravel application.
An example of this challenge:
A client who is a photographer. He wants website where he can showcase a gallery of his photographs in a gallery page. He also wants to display the latest the photographs on the home page under the title latest images.
He has an admin page where he can upload all his photographs to a database.
If anyone has an idea how to do this, I will appreciate it!
Thanks!

There are allot of ways of solving this problem, i would recommend building a gallery component. This component can be used on the home and gallery page.
You can parse the image models to the component see Passing Additional Data To Components https://laravel.com/docs/5.7/blade#components-and-slots.

Related

Wordpress - Make Gallery Posts from existing Photo Posts

I want to start a photo blog on Wordpress. My Idea is to post raw pictures as posts. 1 pohoto per post. And then users can search for pictures (separate posts) and add them to galleries of their own, and then post those galleries.
Now, I can code this but first I thought to look up for something related, if available, then i'll code it if not found.
So, do you guys know any plugin which can do this or any alternative method for my plan?
thank
* Update:
* The users will post the galleries in my site.
* What I have thought to do is to collect POST IDs of the images/posts which users select for a gallery and put it as an array in the new gallery post, so on POST show request, I'll just get the first image (attached image) from each of those IDs.
This can be done OOTB in WordPress, but something that isn't clear is - are the users posting galleries (a collection of posts) to your site to their profile? or their site?
Short simple answer to your question, plugins normally solves problems - your problem isn't clear. So no, I don't know of a plugin solution.

How to automatically tweet when a new article added to Joomla

I have a free wordpress blog which automatically tweets my new article through my twitter account which I have no idea how wordpress does it. I want to do the same thing on Joomla 3.2.3 platform.
What I want to do is when I add a new article into a specific category, I want Joomla to tweet the article's url automatically.
What I have tried is to search for a couple of components doing this. But I am stucked at API/Key-API/Secret validation. The component (AutoTweetNG) needs tweeter API to have read and write level. So I have many web sites to apply this application. In order to have read and write rights twitter asks me to enter mobile phone number in the profile page.
I have decided to make this by hard coding. Is there any oppurtunity to achieve this? It looks it is gonna be a little robot things, and twitter does not let me.
At least it would be great if thic could be done using PHP only.
Try this,
You can achieve it using two things in Joomla, One is create a twitter Oauth APP also create a content plugin for auto tweet.
First you have to create an app with twitter just follow the link.
Then Create a Joomla content plugin with onContentAfterSave event.
Then Once you create an article it will automatically tweets.
Hope its helps..

Setting category and other metadata via MediaWiki API

I have a lot of data that I want to upload to mediawiki with content and category metadata.
I found Api.php?action=edit for uploading and some bots framework in php
but I cant find any thing for setting the category.
Anybody know how to set category data with mediaWiki API or any framework?
If you want to add some page to a category, you would do it the same way as if you were editing the page manually: by adding code like [[Category:Some Category]] to the end of the article.

Simple CakePHP Portfolio

I am building a very simple website ( http://driz.co.uk/beta/ ) using CakePHP to show a portfolio of my work as well a few pages such as about me and contact. I was thinking of just creating each item for my portfolio as a page inside the /views/pages/ folder but seen as I'm wanting to learn a bit about CakePHP I thought it would be probably better to use a database and store each item in a simple table.
What I need to do is have a simple page like /portfolio/ which lists all my work to date and then links to each item I have so for example /portfolio/my-awesome-work/
I also need to list the items in the sidebar as shown in the link.
For each portfolio item I will need a title, a body (which will store the content and images for each item) and also the client information. I don't need any image upload capabilities as I will be just adding the HTML for it in the database table.
If anyone can help it'd be much appreciated.
Thanks
Hopefully you aren't asking for a full solution (frowned upon on SO)
First follow the blog tutorial : http://book.cakephp.org/view/1528/Blog
This is a great place to start as it walks you through all the basics.
As for your particular problem. Creating a portfolios table with all the fields you mentioned and baking the code (you'll know what that means when you follow the tutorial) as a starting point will get you half way there.
You could also add in an admin area to manage your system. This would mean you'd need to create a users table and add the Auth component

Can't find a Wordpress image/photo gallery plugin

I've been looking at Wordpress plugins for photo galleries (so maybe this is for superuser.com), and I've been very frustrated so far. It seems like what I'd like to do would be a very common use case:
Admin: Be able to upload multiple pictures (at a time)
Admin: Be able to assign a "gallery" to those pictures as I upload them
User: Be able to go to a page with a (paged) list of all galleries
User: Be able to click on gallery and view the images (again, probably paged) in that gallery
User: Be able to click on an image to get larger/largest sizes
User: Be able to leave comments on individual pictures (this is a "nice to have")
The images/galleries could be totally independent of posts/pages, but it would be nice to be able to embed those images/galleries into posts/pages when necessary.
Is there anything out there like this that I'm missing? I've tried a handful of plugins and none of them seem to be for a use case anywhere close to what I'm looking for. One of the reasons I'm trying to use Wordpress is to reduce time spent coding everything I want.
Check out NextGen Gallery. It's a great image gallery plugin for WordPress.
Try taking a look at the this NextGen site for a walkthrough of all it's features.
Here are two other alternatives that look like they may fit what you're looking for (of course, you may have already tried them unsuccessfully):
PhotoSmash Galleries
Post videos and photo galleries
Good Luck!
Tag Gallery may be of interest to you. You can manage your media via tags from the built in Media Library of Wordpress and this plugin builds galleries from your tags. Pretty nifty.

Categories