mysql -u root -p
create a database by typing the following command:
CREATE DATABASE new_database;
To view a list of the current databases that you have created, use the following command:
SHOW DATABASES;
created_at
column. You will pass the column name that you wish to sort by using orderBy
method.
new method latest() eloquent
public function getLatestRecord()
{
$latests = User::latest()->get();
}
old method OrderBy with latest eloquent
public function getLatestRecord()
{
$latests = \DB::table('users')->orderBy('created_at','desc')->get();
}
new method oldest() eloquent
public function getOldestRecord()
{
$oldest = User::oldest()->get();
}
blade
file on each row@if ($errors->any())
@foreach ($errors->all() as $error)
<div>{{$error}}</div>
@endforeach
@endif
$errors->has('accountable_id')
did not work @if($errors->has('accountable_id'))
<div class="invalid-feedback">
<strong>{{ $errors->first('accountable_id') }}</strong>
</div>
@endif
Until is-invalid
class was specifiedclass="form-control {{ $errors->has('accountable_id') ? 'is-invalid' : '' }}"
The complete example<div class="form-group">
<label for="exampleSelect2">Accountable <span class="text-danger">*</span></label>
<select class="form-control {{ $errors->has('accountable_id') ? 'is-invalid' : '' }}" id="accountable_id" name="accountable_id">
<option value="">Select Accountable</option>
@foreach($users as $accountable)
<option value="{{ $accountable->id }}" {{ $accountable_id == $accountable->id ? 'selected' : '' }}>{{ $accountable->name }}</option>
@endforeach
</select>
@if($errors->has('accountable_id'))
<div class="invalid-feedback">
<strong>{{ $errors->first('accountable_id') }}</strong>
</div>
@endif
</div>
$firstname = "Peter";
$lastname = "Griffin";
$age = "41";
$result = compact("firstname", "lastname", "age");
print_r($result);
pm.environment.set("allowedMilliseconds", 100);
pm.test("Response time is less than "+pm.environment.get("allowedMilliseconds")+"ms", function () {
pm.expect(pm.response.responseTime).to.be.below(pm.environment.get("allowedMilliseconds"));
});
<?php
$str = "Visit W3Schools";
$pattern = "/w3schools/i";
echo preg_match($pattern, $str);
?>
<?php
$values = array(false, true, null, 'abc', '23', 23, '23.5', 23.5, '', ' ', '0', 0);
foreach ($values as $value) {
echo "is_string(";
var_export($value);
echo ") = ";
echo var_dump(is_string($value));
}
?>
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>