<commit_before><?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use App\Gas;
use App\User;
use App\Role;
use App\Supplier;
use App\Product;
use App\Measure;
use App\Category;
use App\VatRate;

class DemoSeeder extends Seeder
{
    public function run()
    {
        $gas = Gas::where('name', '!=', '')->first();

        $gas->name = 'GAS Demo';
        $gas->message = "Questa istanza permette di avere una idea del funzionamento di GASdottoNG.\n\nPer accedere:\nUtente amministratore: username: root, password: <PASSWORD>\nUtente non privilegiato: username: user, password: <PASSWORD>\nGAS<PASSWORD>NG è un progetto in continua evoluzione: se noti qualcosa che non va, o una funzione che manca, mandaci una mail a <EMAIL>";
        $gas->save();

        User::create([
            'id' => str_slug('Utente Normale'),
            'gas_id' => $gas->id,
            'member_since' => date('Y-m-d', time()),
            'username' => 'user',
            'firstname' => 'Mario',
            'lastname' => 'Rossi',
            'password' => <PASSWORD>('<PASSWORD>'),
        ]);

        $referrer_role = Role::where('name', 'Referente')->first();
        $administrator = User::where('username', 'root')->first();

        $data = [
            'Fornitore delle Mele' => [
                '<NAME>',
                '<NAME>',
                '<NAME>',
            ],
            'Fornitore delle Arance' => [
                'Arance',
                'Mandarini',
                'Clementine',
            ],
        ];

        $measure = Measure::where('name', '=', 'Chili')->first();
        $category = Category::where('name', '=', 'Frutta')->first();
        $vat_rate = VatRate::where('percentage', '=', '22')->first();

        foreach ($data as $s_name => $products) {
            $s = Supplier::create([
                'id' => str_slug($s_name),
                'name' => $s_name,
                'order_method' => '',
                'payment_method' => ''
            ]);

            foreach ($products as $p_name) {
                Product::create([<commit_msg>fix seeder istanza demo<commit_after><?php

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use App\Gas;
use App\User;
use App\Role;
use App\Supplier;
use App\Product;
use App\Measure;
use App\Category;
use App\VatRate;

class DemoSeeder extends Seeder
{
    public function run()
    {
        $gas = Gas::where('name', '!=', '')->first();

        $gas->name = 'GAS Demo';
        $gas->message = "Questa istanza permette di avere una idea del funzionamento di GASdottoNG.\n\nPer accedere:\nUtente amministratore: username: root, password: <PASSWORD>\nUtente non privilegiato: username: user, password: <PASSWORD>GASdot<PASSWORD> è un progetto in continua evoluzione: se noti qualcosa che non va, o una funzione che manca, mandaci una mail a <EMAIL>";
        $gas->save();

        User::create([
            'id' => str_slug('Utente Normale'),
            'gas_id' => $gas->id,
            'member_since' => date('Y-m-d', time()),
            'username' => 'user',
            'firstname' => 'Mario',
            'lastname' => 'Rossi',
            'password' => <PASSWORD>('<PASSWORD>'),
        ]);

        $referrer_role = Role::where('name', 'Referente')->first();
        $administrator = User::where('username', 'root')->first();

        $data = [
            'Fornitore delle Mele' => [
                '<NAME>',
                '<NAME>',
                '<NAME>',
            ],
            'Fornitore delle Arance' => [
                'Arance',
                'Mandarini',
                'Clementine',
            ],
        ];

        $measure = Measure::where('name', '=', 'Chili')->first();
        $category = Category::where('name', '=', 'Frutta')->first();
        $vat_rate = VatRate::where('percentage', '=', '22')->first();

        foreach ($data as $s_name => $products) {
            $s = Supplier::create([
                'id' => str_slug($s_name),
                'name' => $s_name,
                'order_method' => '',
                'payment_method' => ''
            ]);

            $gas->suppliers()->attach($s->id);

            foreach ($products as $p_name) {
                Product::create([
{'fraction_non_alphanumeric': 0.1712409101571663, 'fraction_numerical': 0.0009383063570255688, 'mean_word_length': 2.0500715307582262, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 72, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4803866', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1316, 'n_words': 291}