Results: 1578
Notes
  • Newest first
  • Oldest first
  • Newest first(All)
  • Oldest first(All)
set and get environment variables
Set an environment variable
allowedMilliseconds
with value
100
pm.environment.set("allowedMilliseconds", 100);
Get the environment variable
pm.environment.get("allowedMilliseconds")
The environment variable in real use case. In this example response time is checked to be below 100ms
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"));
});
by Valeri Tandilashvili
4 years ago
0
Postman
test automation
0
set and get global variables
Set an global variable
allowedMilliseconds
with value
100
pm.global.set("allowedMilliseconds", 100);
Get the global variable
pm.global.get("allowedMilliseconds")
The global variable in real use case. In this example response time is checked to be below 100ms
pm.test("Response time is less than "+pm.global.get("allowedMilliseconds")+"ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(pm.global.get("allowedMilliseconds"));
});
by Valeri Tandilashvili
4 years ago
0
Postman
test automation
0
The command below makes Git
forget
about
test.php
that was tracked but is now in
.gitignore
git rm --cached test.php
The command makes Git
forget
about all files under
docs
directory that was tracked but is now in
.gitignore
git rm -r --cached docs/
by Valeri Tandilashvili
4 years ago
0
Git
1
Generate a model and a migration, factory, seeder, and controller CODE
You may generate various other types of classes when generating a model, such as factories, seeders, and controllers. In addition, these options may be combined to create multiple classes at once:
# Generate a model and a FlightFactory class...
php artisan make:model Flight --factory
php artisan make:model Flight -f

# Generate a model and a FlightSeeder class...
php artisan make:model Flight --seed
php artisan make:model Flight -s

# Generate a model and a FlightController class...
php artisan make:model Flight --controller
php artisan make:model Flight -c

# Generate a model and a migration, factory, seeder, and controller...
php artisan make:model Flight -mfsc
by გიორგი ბაკაშვილი
4 years ago
1
Laravel
php artisan make
laravel official doc
3
Class based model factories in Laravel 8 CODE
create a new factory for the Book model using the following Artisan command
php artisan make:factory BookFactory --model=Book
.it would generate a
 BookFactory.php
file under
database/factories 
which looks like so.
<?php

namespace Database\Factories;

use App\Models\Book;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class BookFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = Book::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            //
        ];
    }
}
define the definition method like so.
public function definition()
{
    return [
        'title' => $this->faker->name,
        'author' => $this->faker->name,
        'published' => 1
    ];
}
Using the factories Once the
BookFactory 
is created, it’s now ready to be used. For instance, we can use it in the
database/seeders/DatabaseSeeder.php
class like so.
<?php

namespace Database\Seeders;

use App\Models\Book;
use App\Models\User;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        Book::factory(5)->create();
    }
}
Notice, you can now directly use the factory on the model instance (App\Models\Book in this case) that is because when you create a model using the
php artisan make:model Book
Artisan command in Laravel 8, it generates the model which includes the new
HasFactory
trait. So, our Book model looks like so.
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Book extends Model
{
    use HasFactory;
}
by გიორგი ბაკაშვილი
4 years ago
0
Laravel
Factory
0
Laravel factory
Laravel has a feature called model factories that allows you to build fake data for your models Generate Dummy Users:
laravel 8 version
php artisan tinker
  
User::factory()->count(5)->create()
laravel 6, 7 version
php artisan tinker
  
factory(App\User::class,5)->create();
This by default created factory of laravel. you can also see that on following url:
database/factories/UserFactory.php
.
by გიორგი ბაკაშვილი
4 years ago
0
Laravel
Tinker
1
Displaying Your Current Laravel Version
php artisan --version
`
by გიორგი ბაკაშვილი
4 years ago
0
Laravel
version
laravel official doc
2
<form action="" method="get">
		<fieldset>
			<legend>Personal info:</legend>
			<label for="first_name">first name:</label><input type="text" name="first_name" id="first_name"><br/>
			<label>last name:</label><input type="text" name="last_name"><br/>
		</fieldset>
		<br/>
		<fieldset>
			<legend>Hobbies:</legend>
			<label>sport</label><input type="checkbox" value="sport">
			<label>sport</label><input type="checkbox" value="gaming">
		</fieldset>
		<br/>
		<input type="submit" value="submit">
</form>
by თენგიზ მაღლაფერიძე
4 years ago
0
HTML
Tutorial 50
HTML5 and CSS3 beginners tutorials
0
<form action="" method="get">
		Name:<input type="text" name="name"><br/>
		Password:<input type="password" name="password"><br/>
		CheckBoxes:<br/>
		1<input type="checkbox"  value="2" name="checker">
		2<input type="checkbox" value="2" name="checker">
		<br/>
		<input type="file"/><br/>
		<input type="submit" value="submit"><br/>
		<input type="reset" value="reset">
</form>
by თენგიზ მაღლაფერიძე
4 years ago
0
HTML
Tutorial 49
HTML5 and CSS3 beginners tutorials
0
<form action="" method="get">
	What do you do?:
	<textarea name="story"></textarea>

</form>
by თენგიზ მაღლაფერიძე
4 years ago
0
HTML
Tutorial 48
HTML5 and CSS3 beginners tutorials
0
Results: 1578