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
/** | |
* Get Youtube id from the URL | |
* Some examples are | |
* https://youtube.com/shorts/dQw4w9WgXcQ?feature=share | |
* //www.youtube-nocookie.com/embed/up_lNV-yoK4?rel=0, | |
* http://www.youtube.com/user/Scobleizer#p/u/1/1p3vcRhsYGo | |
* http://www.youtube.com/watch?v=cKZDdG9FTKY&feature=channel | |
* http://www.youtube.com/watch?v=yZ-K7nCVnBI&playnext_from=TL&videos=osPknwzXEas&feature=sub | |
* http://www.youtube.com/ytscreeningroom?v=NRHVzbJVx8I |
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
@foreach ($data->chunk(3) as $row) | |
<div class="row"> | |
@foreach ($row as $s) | |
<div class="col-md-4 col-xs-12"> | |
... | |
</div> | |
@endforeach | |
</div> | |
@endforeach |
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
$current_month = 3; | |
$current_year = 2020; | |
//first day of previous month from given month and year | |
$firstDayOfLastMonth = date_create($current_year.'-'.$current_month.'-01 first day of last month')->format('Y-m-d'); | |
//last day of previous month from given month and year | |
$lastDayOfLastMonth = date_create($current_year.'-'.$current_month.'-01 last day of last month')->format('Y-m-d'); | |
//first day of given month and year |
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
<IfModule mod_headers.c> | |
Header set Referrer-Policy "origin" | |
Header set Access-Control-Allow-Origin 'https://cdn.ampproject.org' | |
Header set AMP-Access-Control-Allow-Source-Origin 'https://yoursite.com' | |
</IfModule> |
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
<script> | |
$(".add").click(function () { | |
var data = $('#form').serializeArray(); | |
data.push({name: '_token', value: $('input[name=_token]').val()}); | |
$.ajax({ | |
type: 'POST', | |
url: 'ajaxmovies', | |
data: data, | |
success: function (data) { | |
toastr.success('Successfully added Module!', 'Success Alert', {timeOut: 5000}); |
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
// If you want to use the Model object if it exists: | |
$model = Model::where('column', '=', Input::get('column'))->first(); | |
if ($model === null) { | |
// Model doesn't exist | |
} | |
// If only to check if exist or not | |
if (Model::where('column', '=', Input::get('column'))->count() > 0) { | |
// Model found | |
} |