This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/). | |
| This cheatsheet is specifically *Markdown Here's* version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a *Markdown Here* email, but it should be pretty close. | |
| You can play around with Markdown on our [live demo page](http://www.markdown-here.com/livedemo.html). | |
| ##### Table of Contents | |
| [Headers](#headers) | |
| [Emphasis](#emphasis) | |
| [Lists](#lists) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $expenses = DB::table('dispatches') | |
| ->select(DB::raw('COUNT(*) as total_dispatch, MONTH(created_at) as month, YEAR(created_at) as year')) | |
| ->groupBy(DB::raw('YEAR(created_at) ASC, MONTH(created_at) ASC'))->get(); | |
| dd($expenses); | |
| $stats = DB::table('dispatches') | |
| ->whereRaw('YEAR(created_at) = ?',2019) | |
| ->groupBy('month') | |
| ->orderBy('month', 'ASC') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var productType = $(this).data('producttype'); | |
| $("select option").each(function(){ | |
| if ($(this).text() == productType) | |
| $(this).attr("selected","selected"); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function collection(Collection $rows) | |
| { | |
| // Initialize number | |
| $numbers = array(); | |
| foreach ($rows as $row) | |
| { | |
| $validator = Validator::make($row->toArray(), [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on store: | |
| $this->validate($request, [ | |
| 'date' => 'unique:mileages,date,NULL,id,user_id,'.\Auth::id(), | |
| 'mileage'=>'required' | |
| 'role_id' => 'required|unique:settings,role_id,NULL,id,org_id,' . Auth()->user()->org_id, | |
| ]); | |
| On update: | |
| $this->validate($request, [ | |
| 'date' => 'unique:mileages,date,'. $id .',id,user_id,'.\Auth::id(), | |
| 'mileage'=>'required' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Model:: | |
| /*Select*/ | |
| select('col1','col2') | |
| ->select(array('col1','col2')) | |
| ->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating')) | |
| ->addSelect('col3','col4') | |
| ->distinct() // distinct select | |
| /*From*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //example demonstrate generating short url from full url | |
| public function getShortUrl($long_Url) | |
| { | |
| $apiKey="AIzaSyByZhZ9RVU3v-ImcTcvAOVqYIEvPeQ4V5wff"; | |
| $data = array('longUrl' => $long_Url, 'key' => $apiKey); | |
| $jsonData = json_encode($data); | |
| $curlObj = curl_init(); | |
| curl_setopt($curlObj, CURLOPT_URL, 'https://www.googleapis.com/urlshortener/v1/url?key='.$apiKey); | |
| curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //edtracting Telephone no and other stuff | |
| <div class="inhalt-links"> | |
| <h2> | |
| Deutsche Verkehrswacht | |
| <br> | |
| Verkehrswacht Dortmund e. V. | |
| <br> | |
| </h2> | |
| <h3> | |
| Standnummer: |
NewerOlder