I needed to make an Eloquent query that could take search terms. The search terms are optional – no search term and the whole dataset is returned. In our particular data model the Users have one or many Associations. So the search term should check for user name, phone, email and association name. In the… Read More »
Create migration in console: Use Schema::table() to access existing table (instead of Schema::create() for creating new tables) Then run migrations:
This tool is fantastic! It saved me many hours of work, when I had complex CSV files I needed to turn into SQL tables http://www.convertcsv.com/csv-to-sql.htm
Different ways of getting a single model and checking if it’s there.
Here’s a simple way to paginate when getting large amounts of posts from the database.
Here’s a great tool for generating dummy data for your database etc. www.generatedata.com
If you save your date in the format of timestamp in your MySQL database, and want to output it like this: Your date come out looking something like this: 2011-01-30 20:54:12 So it’s formated like YYYY-MM-DD HH:MM:SS But what if you want it to display, say like this: Sunday, January 30th, 8:54pm Normally you would… Read More »
This is just a VERY basic gallery that you can modify to suit your needs. For example you could add columns in the database and store more info about the images (date, size, tags etc.). You could very easily make the output use Lightbox or similar images viewers. And you could of course do a… Read More »