martin_k

martin_k

Member Since 2 Months Ago

Experience Points
1,150
Total
Experience

3,850 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
1,150 XP
Sep
30
2 weeks ago
Activity icon

Replied to How To Choose Which User Must Be On The List?

I have a role technician for all technics and I have to add role active_technician for active technics.

protected function getTechniciansList() {

    $technicians = Role::whereName('technician')->with('users')->get();

    foreach ($technicians as $role) {
        $technicians = $role->users;
    }

    return $technicians->filter(function ($id) {
        return $id->password != '';
    })->prepend(null)->lists('firstname', 'id');

}
Activity icon

Started a new conversation How To Choose Which User Must Be On The List?

I have a code like this:

protected function getPositionsList()
{

    $positions = DeliveryPosition::all();
    return $positions->filter(function ($value) {
        return $value->name != 'delivered';
    })->sortBy('label')->prepend(null)->lists('label', 'id');

}

I have a list with all technics man but some are not working now. Where I have to put user_id from technics to show only active technics?

Sep
19
3 weeks ago
Activity icon

Replied to Print Automatically With Close The Form

Yes, to the physical printer. Now print buttom created a pdf and than I print it. I would like to do it automatically.

Activity icon

Replied to Print Automatically With Close The Form

I have in it javascript in edit.blade.php and with the buttom it works. How can I do it automatically. I don't want to press the buttom printer. I would like to have it automatically. How I can add print function to controllers after send email.

Activity icon

Started a new conversation Print Automatically With Close The Form

Hi.

I have a button print and it works good. I have to make it automatically when I will close the form I would like to print it also.

At the moment the form send an email to my customers with order (it works very good) but now I would like to add also automatically print without the button print.

Please help me. I am beginner here.

Sep
17
4 weeks ago
Activity icon

Replied to Send Email With Different Data

Code from emails.einkaufen:

{{$data}} - {{$data1}} {{$data2}} - {{$data3}} {{$data4}} - {{$data5}} {{$data6}} - {{$data7}} {{$data8}} - {{$data9}}

Activity icon

Replied to Send Email With Different Data

I have this code: ' Mail::send('emails.einkaufen', ['data'=>$request['repair_report_einkaufen'], 'data1'=>$request['repair_report_einkaufen1'], 'data2'=>$request['repair_report_einkaufen2'], 'data3'=>$request['repair_report_einkaufen3'], 'data4'=>$request['repair_report_einkaufen4'], 'data5'=>$request['repair_report_einkaufen5'], 'data6'=>$request['repair_report_einkaufen6'], 'data7'=>$request['repair_report_einkaufen7'], 'data8'=>$request['repair_report_einkaufen8'], 'data9'=>$request['repair_report_einkaufen9']], function ($m) use ($delivery) { $m->from('[email protected]', 'Einkaufen Service Rickim Elektronik GmbH');

            $m->to('[email protected]', 'Einkaufen ')->bcc('[email protected]')->subject('Der Einkauf! - ' . $delivery->order_number);
        });'
Activity icon

Replied to Send Email With Different Data

Now, The mail is sending but now I have to put text in every textarea. To database it is saved only if there is data, but for sending mail the data must be in every field. Sometimes I need 4 texts area but sometimes I need only 2. Hoe I can setup it if I will have nothing in text area please don't send it. I want to send by email only filled text area.

Activity icon

Replied to Send Email With Different Data

It is 2 differents textarea. I have to give exactly know where must be repair_report_einkaufen and repair_report_einkaufen1. Can I put repair_report_einkaufen as a 'data' and repair_report_einkaufen1 as a 'data1'

Activity icon

Started a new conversation Send Email With Different Data

Hi.

I have code: Mail::send('emails.einkaufen', ['data'=>$request['repair_report_einkaufen']], function ($m) use ($delivery)

but I have to send also in email.einkaufen also data from 'repair_report_einkaufen1. How can I add second data?

Sep
13
1 month ago
Activity icon

Replied to Send Automatical Email After Save To Database

@tykus I sent you a code. What do you thing which public function I have to use here to send text from textarea after save to database?

Activity icon

Replied to Send Automatical Email After Save To Database

I thing i have to add public function to send it also by email to one specific email address.

Activity icon

Replied to Send Automatical Email After Save To Database

<?php

namespace App;


use App\Events\UserNotificationEvent;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

/**
 * Class History
 * @package App
 */
class HistoryEinkaufen extends Model
{

    /**
     * @var string
     */
    protected $table = 'historyeinkaufen';

    /**
     * @var array
     */
    protected $guarded = ['id'];

    /**
     * Boot
     */
    protected static function boot()
    {
        parent::boot();

        self::created(function ($model)
        {
            if ($model->user_id)
            {
                $delivery = Delivery::find($model->delivery_id);
                if ($delivery->user_id)
                {
                }
            }
        });
    }

    /**
     * @param $query
     * @return mixed
     */
    public function scopeLast($query)
    {
        return $query->orderBy('id', 'DESC');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function seen()
    {
        return $this->hasMany(HistorySeen::class, 'history_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function delivery()
    {
        return $this->hasOne(Delivery::class, 'id', 'delivery_id');
    }

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }

    public function getTimeLabel()
    {
        $created = $this->created_at;
        $now = new Carbon();

        $diffInDays = $now->diffInDays($created);
        if ($diffInDays < 2)
        {
            return '';
        }
        if ($diffInDays >= 2 && $diffInDays < 4)
        {
            return '#FFAAAA;color:#FFF';
        }
        if ($diffInDays >= 4 && $diffInDays <= 6)
        {
            return '#D46A6A; color:#FFF';
        }

        return '#801515; color:#FFF';
    }

}
Activity icon

Replied to Send Automatical Email After Save To Database

It is a code for textarea

                        <h4><i class="fa fa-file-text"></i> Mitteilung - Einkaufen</h4>
                        <div class="summernote-wrapper">
                            <textarea name="repair_report_einkaufen" class="summernote"></textarea>
                        </div>
Activity icon

Replied to Send Automatical Email After Save To Database

skauk I don't know why but it doesn't work. Which exactly public function I have to use?

Could you send example code?

I can save to database, it works. But I can't send email with exactly data what was in textarea.

Activity icon

Replied to Send Automatical Email After Save To Database

skauk exactly what I need. How I can do it?

Activity icon

Started a new conversation Send Automatical Email After Save To Database

I am new here.

I have a project in Laravel. I have one textarea and data from it is save in datavase. It works good. Now I would like to send automatical email to one specific email address with this data. It must be sent only one time with save to database.

I have no problem with sending email to customer with data but now I need to send email with data from this textarea to one specific email. It is a textarea what we have to buy for customer. It must be sent to our cooperation company.

Is it possible?

Aug
09
2 months ago
Activity icon

Replied to Route In Http

Ok, I didn't know but I know now and I will use it.

Activity icon

Replied to Route In Http

I put this answer because nobody gave me it. It is only why I put it.

Activity icon

Replied to Route In Http

The right solution is prepare a SSL local certificate, install it and prepare line with info where is the certificate. After that everything is work fine.

Activity icon

Replied to Math In Laravel (netto - Brutto)

$delivery->bedrag_rechnung_netto = $request['bedrag_rechnung_brutto']/1.19;

Activity icon

Started a new conversation Math In Laravel (netto - Brutto)

Hi.

I have code:

                    <div class="col-md-3">
                        <h4><i class="fa fa-hashtag"></i> Rechnung preis - Brutto €</h4>
                        <div class="form-group form-group-default">
                                <h5><strong>{{ $data->bedrag_rechnung_brutto }}</h5></strong>
                        </div>
                    </div>

But I have also another field Rechnung preis - Netto. What must be the code for calculate netto-brutto from bedrag_rechnung_brutto. It must be -19%.

Netto = brutto /1,19.

Aug
08
2 months ago
Activity icon

Replied to Don't Create Field In Database

Ok, after your sugestion I have mistake:

BadMethodCallException in Macroable.php line 74: Method filled does not exist.

Aug
07
2 months ago
Activity icon

Replied to Don't Create Field In Database

FatalThrowableError in OrderController.php line 850: Parse error: syntax error, unexpected ';'

Something is wrong.

Activity icon

Replied to Don't Create Field In Database

I have a mistake:

FatalThrowableError in OrderController.php line 850: Parse error: syntax error, unexpected ';'

Something is wrong.

Activity icon

Started a new conversation Don't Create Field In Database

I have a code like below. It creates a field in database and show in another places. I would like to block create a database field if message field is not exit. Rest fields are taken from system. What is wrong in my code.

    $delivery->comments_buro()->create([
        'name' => auth()->user()->firstname,
        'user_id' => auth()->user()->id,
        'message' => $request['repair_report_buro'],
        'icon' => 'fa fa-commenting-o',
        'style' => $position->style,
    ]);
Aug
01
2 months ago
Activity icon

Replied to Route In Http

Yes, exactly for dev environment.

I put this in project's directory: php -S localhost:3000 -t public

and I open the project with: localhost:3000

Activity icon

Started a new conversation Route In Http

Where can I change route from https for http? I have my project in https online but offline it will be in http. I have to change it. Please send info where is it?

Martin

Activity icon

Replied to SSL

I have my local domain. It is syworkx.local but I have to open my project in localhost:3000.

Before I put:

php -S localhost:3000 -t public

in project directory.

Activity icon

Started a new conversation SSL

Hi.

I have a SSL certyficate for my local domain syworkx.local. Could somebody help me with with setup it? I have nginx.

Martin

Jul
31
2 months ago
Activity icon

Started a new conversation SSL

I have my projects online with SSL certificate but I would like also use it offline. Of course for test. How can I solve the problem with SSL certyficate? I have info;

[Wed Jul 31 14:51:42 2019] [::1]:63868 Invalid request (Unsupported SSL request)[Wed Jul 31 14:51:42 2019] [::1]:63869 Invalid request (Unsupported SSL request)

Thank. Martin

Activity icon

Started a new conversation Apache Admin - Xampp

I have a problem. I am new here.

I put "admin" button in xampp control panel and I have ma project site. When my virtual host is off "admin" button doesn't work.

localhost = syworkx.local

How I can fix it? I tried fix it from one week.

I have many projects. I have ma projects in: C:\xampp\htdocs\projects

Regards. Martin

Jul
30
2 months ago
Activity icon

Replied to Start A Project Offline

homestead: SSH auth method: private key

It blocked with this line!!!

Activity icon

Replied to Start A Project Offline

No, I don|t use it but I will try it now. Thanks for help.

After that I will inform about result.

Activity icon

Started a new conversation Start A Project Offline

Hi.

I am new here and I tried to start a project offline. From the beginning I have the same problem. I have a local domain (syworkx.local). I have line in hosts (in windows directory), I have line in httpd-vhosts.conf with info where is exactly the servis. I have also info in .env what is the app_dir.

The homepage is works ok but after successfully login I have a wrong route. I see the syworkx.local/dashboard but from wrong directory.

I have the same if I put localhost or syworkx.local in chrome. I have many projects in my xampp.

What exactly I have to change to start the project? I would like to explain that online everything is works good.

Please somebody help me. I know it is a small detail but my project doesn't work.

Thanks for help.

Jul
29
2 months ago
Activity icon

Replied to Wrong URL

I have in .env:

APP_ENV=production APP_DEBUG=true APP_KEY=3wtKR5gTkgcpA9PGhEEm8Dx5ItVCMFtC APP_URL=syworkx.local

but it doesn't work. I have the same when I type localhost and syworkx.local.

The homepage is ok but after login a have a dashboard from C:\xampp\htdocs\dashboard not from C:\xampp\htdocs\syworkx\resources\views\dashboard. How can I fix this redirection?

Jul
22
2 months ago
Activity icon

Replied to Wrong URL

xampp\htdocs\index.php

""<?php if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { $uri = 'https://'; } else { $uri = 'http://'; } $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/dashboard/'); exit; ?>""

Maybe there is a problem here?

Activity icon

Replied to Wrong URL

I have many projects in \xampp\htdosc not only one.

I have many local domains. It is the reason why must be the different between local host and syworkx.local.

Martin

Activity icon

Replied to Wrong URL

Every laravel website open dashboard from localhost/dashboard not from from directory with project!!!!!

I know it is the problem but I can't find the solution for it. Online everything works very good.

Please help me!!!!

Activity icon

Replied to Wrong URL

I don't know why localhost and syworkx.local has the same result? Maybe here is the problem?

Activity icon

Replied to Wrong URL

OK, but the problem is not solved all the time.

Activity icon

Replied to Wrong URL

Ok, but the problem is not solved. My offline site doesn't work all the time.

I will put "best answer" when it will be solved.

Martin

Activity icon

Replied to Wrong URL

After: php artisan cache:clear php artisan route:clear php artisan view:clear

I put:

PS C:\xampp\htdocs\syworkx> php artisan serve Laravel development server started on http://localhost:8000/

Activity icon

Replied to Wrong URL

which is right?

<VirtualHost *:80> ServerAdmin [email protected] ServerName syworkx.public DocumentRoot "C:/xampp/htdocs/syworkx/public/" <Directory "C:/xampp/htdocs/syworkx/public/"> DirectoryIndex index.php

or

<VirtualHost *:80> ServerAdmin [email protected] ServerName syworkx.local DocumentRoot "C:/xampp/htdocs/syworkx/public/" <Directory "C:/xampp/htdocs/syworkx/public/"> DirectoryIndex index.php

Activity icon

Replied to Wrong URL

My config/app.php:

/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/

'url' => 'APP_URL',

Do you need all file or it is enough?

Activity icon

Replied to Wrong URL

I rewrite it, restarted xampp and no changed. Everything is the same.

Activity icon

Replied to Wrong URL

I put your text, restarted xampp and next run command from powershell directly from syworkx directory but it made no chnge. Everything is the same.

Does Somebofy has a different idea?

Activity icon

Replied to Wrong URL

httpd-vhosts.conf:

<VirtualHost *:80> ServerAdmin [email protected]xxx (here is my email address) DocumentRoot "C:/xampp/htdocs/syworkx/public/" ServerName syworkx.public ##ErrorLog "logs/dummy-host2.example.com-error.log" ##CustomLog "logs/dummy-host2.example.com-access.log" common

host:

127.0.0.1 localhost ::1 localhost 127.0.0.1 buchhaltung.local 127.0.0.1 manager.local 127.0.0.1 statistics.local 127.0.0.1 holidays.local 127.0.0.1 warehouse.local 127.0.0.1 rent-home24.com.local 127.0.0.1 www.rent-home24.com.local 127.0.0.1 prestashop.local 127.0.0.1 xdebug.local 127.0.0.1 blog.local 127.0.0.1 supply.local 127.0.0.1 usersmanagement.local 127.0.0.1 buchhaltung.local 127.0.0.1 ninja.local 127.0.0.1 cryptomator-vault 127.0.0.1 syworkx.local

Martin

Activity icon

Replied to Wrong URL

There is my .env

APP_ENV=production APP_DEBUG=true APP_KEY=3wtKR5gTkgcpA9PGhEEm8Dx5ItVCMFtC APP_URL=localhost

Martin