Laravel Community Tools by Tighten

Tag "view data" tricks

55 tricks
reponse:json() to remove "" from numeric values
extjac 11 years ago 9188
Laravel de URL desenlerini yazılımcının sabit bir yaklaşımından uzaklaştırarak SEO için renklendirmeye yarayan bazı kullanımları.. http://elmacademy.net/
doguhan 11 years ago 8480
İşin Türkçesi şu: Controller dan Master içine değer aktarılarak tüm view ler için özelleştirilebilir head meta tag yada diğer değişmesini istediğimiz dinamik alanların oluşturulması..
doguhan 11 years ago 7702
You have election data in your database. Perhaps each candidate has 1 record, with his/her name and number of votes. The percentage of the vote that each candidate attained can be calculated per candidate, without having to loop through the data. Laravel's Collection class provides the `sum($column_name)` method, which sums the column totals. This can then be used to calculate the vote share. I've used PHP's `format_number` function to round up the final percentage. Extra points given for a bootstrap progress bar, to illustrate the vote share.
meigwilym 11 years ago 19831
If we have a blog, sometimes we want to display all latest posts by category. Take an example with this website where I put those posts in a carousel on the homepage: http://dadack.com
mercuryser... 11 years ago 17571
In many case you want to display values in blade you can do some check sum like this:
star18bit 11 years ago 16417
When showing a website through a Facebook Page tab validation errors are not displayed, because Facebook "forgets" the sessions due to the page proxy. One problem with this is that session data is destroyed / forgotten on each request going through that proxy. This applies to Redirect::back()->withErrors($validator) for showing the form with validation errors because sessions are used . To avoid this simply fiddle the error data together and pass it directly to the respective action that handles the input form. One thing to mention is that calling other controller actions directly of course does not affect the route. Let's say editing happens at "/edit" and the "registration complete" message is shown at "/complete". Calling the action within the controller the form with errors is now shown at "/complete" whereas "/edit" would be shown if you redirected back (Line 22). I personally don't really care too much about this since the "real" web address is not shown in the FB page tab anyway due to the page proxy. Looking forward to hearing your opinions on this. Maybe there is even a better way.
flei 11 years ago 13860
Whoops, looks like something went wrong.
yuran 11 years ago 21119
Loading views from a different location, other than 'app/views'
Whyounes 11 years ago 9539