Waldemar

Waldemar

Member Since 2 Years Ago

Experience Points 11,300
Experience Level 3

3,700 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 73
Lessons
Completed
Best Reply Awards 3
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

13 Jun
1 year ago

Waldemar started a new conversation Add In Array

Hello every one! I need to add in array elements new data

My php code

var_dump(ResourceType::all()->pluck('type', 'type'));

My result

object(Illuminate\Support\Collection)[641]
  protected 'items' => 
    array (size=7)
      'Back-End' => string 'Back-End' (length=8)
      'Design' => string 'Design' (length=6)
      'Development' => string 'Development' (length=11)
      'Front-End' => string 'Front-End' (length=9)
      'Markup' => string 'Markup' (length=6)
      'Seo' => string 'Seo' (length=3)

i want for every element add selected key. For example

array(
               array(
                   'value' => 'Back-End',
                   'selected' => false,
            ),
        array(
                   'value' => 'Front-End',
                   'selected' => true,
        )
       ),
05 Jun
1 year ago

Waldemar started a new conversation Take Data And Insert Data

Hello! I need insert data with relations in page_block_settings table. How I can do this? And then i must selct this full table http://prntscr.com/jr4yja Image

04 Jun
1 year ago

Waldemar left a reply on Take A 3 Tables

@Sergiu17 Yes, thanx! =)

Waldemar started a new conversation Take A 3 Tables

i need take a 3 tables from DB with eloquent

$page = Page::find(1);
$page->block->subBlock->toArray();

how to take that?

03 May
1 year ago

Waldemar left a reply on PIvot Table

@bashy how?

01 May
1 year ago

Waldemar started a new conversation PIvot Table

Help please some one! I need to insert data in pivot table from 3 tables. http://prntscr.com/jcd6lx

block model

public function obj()
{
     return $this->belongsToMany(Obj::class, 'obj_block', 'block_id', 'obj_id');
}

Obj model

    {
        return $this->belongsToMany(Block::class, 'obj_block', 'block_id', 'obj_id');
    }

    public  function objState()
    {
        return $this->belongsToMany(ObjState::class, 'obj_block', 'block_id', 'obj_state_state')->withPivot('obj_state_state');
    }

ObjState model

public function obj()
    {
        return $this->belongsTo(Obj::class, 'obj_block', 'obj_id', 'obj_state_state');
    }

Controller

                    // Insert data into `block`
                    $block = new Block([
                        'name' => 'Блок 1',
                        'img' => 'image.jpg',
                        'description' => 'Описание блока 1'
                    ]);
                    $block->save();

                    // Insert data into `obj`
                    $obj = new Obj([
                        'name' => 'Object 1'
                    ]);
                    $obj->save();

                    // Insert data into `obj_state`
                    $objState = new ObjState([
                        'state' => str_random(10)
                    ]);
                    $objState->save();

                    $calc->page()->save($page); // Relation Page to Calc
                    $page->block()->save($block); // Relation Block to Page
                    $block->obj()->save($obj); // Relation Obj to Block
                    $obj->objState()->save($objState);

Plesase help what i do wrong?

23 Sep
1 year ago

Waldemar left a reply on Laravel And Vue

@tisuchi Thanks!

22 Sep
1 year ago

Waldemar started a new conversation Laravel And Vue

Hi! Some one have a tutorial CRUD laravel 5 and vue2. I watch the veucasts but i dont understand how i can best structure for site. I must understand how to create crud with best practies. Sorry for my english

19 Sep
1 year ago
18 Sep
1 year ago

Waldemar left a reply on Uploading Large Dimension Files

ohhh... Show me your rules for your form

17 Sep
1 year ago

Waldemar left a reply on Uploading Large Dimension Files

Ok!

  1. Maybe in .htaccess have error.
  2. Whong php.ini error (but i this no error)
  3. You dont have permission on your folder where upload

Waldemar left a reply on Uploading Large Dimension Files

show me your form! Please maybe you dont have enctype="multipart/form-data"?

Waldemar left a reply on Uploading Large Dimension Files

upload_max_filesize = 150M
post_max_size = 150M
memory_limit = 512M
max_execution_time = 1200

Try this parameters

16 Sep
1 year ago

Waldemar left a reply on Uploading Large Dimension Files

Apache or nGinx?

05 Sep
1 year ago

Waldemar left a reply on Middleware Exceptions

some one have an idea?

02 Sep
1 year ago

Waldemar started a new conversation Middleware Exceptions

Hi! I create the middleware isAdmin and i want exception gust 2 routes /login and /logout

    public function handle($request, Closure $next)
    {
        if(Auth::user() && Auth::user()->admin == 1)
            return $next($request);

        return redirect(\Config::get('app.front_url'));
    }

and my RouteServiceProvider

    protected function mapWebRoutes()
    {
        Route::middleware('admin')
             ->namespace($this->namespace)
             ->group(base_path('routes/web.php'));
    }

This middleware work on full site, now when i go to the /login i have the redirect to frontend from backend. How i can exception some route in middleware?

01 Sep
1 year ago

Waldemar left a reply on Redirect If 404

@papa i want the redirect if 404

Waldemar started a new conversation Redirect If 404

Hello! I create middleware for backend sub.domain i want if 404 error on backend redirect to frontend Please help some one! Sorry for my English

    public function handle($request, Closure $next)
    {
        if(\Auth::user() && \Auth::user()->admin == 1)
            return $next($request);

        return redirect(\Config::get('app.front_url'));
    }

30 Aug
1 year ago

Waldemar left a reply on Unique Validation Problems

also you can use this

public function messages()
{
    return [
        'email.required' => 'Er, you forgot your email address!',
        'email.unique' => 'Email already taken m8',
    ];
}

Waldemar left a reply on Unique Validation Problems

write if it works

Waldemar left a reply on Unique Validation Problems

@szymon_zak if you use the $table->string('login')->unique(); This error at the database level. The database itself does not allow you to create the same records

if you want your errors try this

$validator = Validator::make($request->all(), [
            'title' => 'required|unique:posts|max:255',
        ]);

        if ($validator->fails()) {
            return redirect('post/create')
                        ->withErrors($validator)
                        ->withInput();
        }

Waldemar left a reply on Unique Validation Problems

You must add flag in create_users_table migration

$table->string('login')->unique();

Waldemar left a reply on Redirect()->action+method=>POST

Some one have ideas?

Waldemar left a reply on Updating Value

$artikli = Artikl::find(1); // for exaple id 1 site.com/admin/artikl/update/1

$artikli->stanje = request('stanje');

$artikli->save();

form you can create everywere

Waldemar left a reply on How To Use A Custom Ngrok Server For Valet

first you must register and paid in ngrok and then you can use self domain

Waldemar started a new conversation Redirect()->action+method=>POST

Hello! Can I do something like this? Or I must create GET route for logout?

middleware

public function handle($request, Closure $next)
    {
        if(Auth::user() && Auth::user()->admin == 1) {
            return $next($request);
        }
        return redirect()->action('Auth\[email protected]out', ['method' => 'POST']);
    }
21 Aug
1 year ago

Waldemar left a reply on Valet Two Folders

@eberkund I hope this will be included in the next version of valet

https://github.com/laravel/valet/pull/95

Waldemar started a new conversation Valet Two Folders

Hello!

I want to create to park folders for example

~/Workstation/ ~/Sites/

For folder workstation i want create sites with domain *.dev but for folder SITES i want to create sites with domain *.local how do this? Please help. Sorry for my English.

04 Jul
1 year ago

Waldemar left a reply on One Function For GET And POST

@Cronix i like use one function =(

Waldemar left a reply on One Function For GET And POST

@Snapey can you show simple example?

Waldemar started a new conversation One Function For GET And POST

Hello!

Can i write different function i want use get and post in one func now i`m use

Route

Route::match(['GET', 'POST'], 'register', 'User\[email protected]')->name('register');

function

public function register(Request $request)
    {
        if ($request->isMethod('GET')) {
            return view('user.registration');
        }

        if ($request->isMethod('POST')) {
            $this->validator($request->all())->validate();
            event(new Registered($user = $this->create($request->all())));
            return $this->registered($request, $user)
                            ?: redirect($this->redirectPath());
        }
    }

How to use a different style of writing GET and POST in one function

Maybe =)

public function register()
{
    function get()
    {
        ///
    }

    function post()
    {
        ///
    }
}

But how?

02 Jul
1 year ago

Waldemar left a reply on Laravel Update

@topvillas I looked at sentinel I did not like their ASL system and I do not know how difficult it is to integrate into sentinel a socialite and another ACL system

Waldemar left a reply on Laravel Update

@topvillas but how? For example I need to remove automatic authorization how to do this? And which file should I edit?

Waldemar started a new conversation Laravel Update

Hi! I changed the vendor \ Illuminate \ Foundation \ Auth \ RegistersUsers.php file and removed the automatic authentication after registration, and when I use comper update, all my changes are gone! = (How do I change the file for the next comper update, my changes have not been touched or I need to write my authorization and registration system so that all the changes are not affected when` comper update '

23 Jun
2 years ago

Waldemar left a reply on User Id

now it ok

protected function create(array $data)
    {
        $code = str_random(30);

        $user =  User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
        
        DB::table('email_verification')->insert(
            array(
                'user_id' => $user->id,
                'code'    => $code
            )
        );
        return $user;
    }

Waldemar started a new conversation User Id

Hello!

I need create user in users table and then add verification_code to email_vefications table but i dont understand how i can get user_id just created. Help please maybe i must use eloquent?

protected function create(array $data)
    {
        $code = str_random(30);
        
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'user_name' => $code,
            'password' => bcrypt($data['password']),
        ]) && DB::table('email_verification')->insert(
            array(
                'user_id' => User::create('id'), //just created used id
                'code'    => $code
            )
        );
    }
30 May
2 years ago

Waldemar started a new conversation Laravel Users

Hi! I find the package for laravel. I need users extended user profile user activation user social activation user change password and other

Maybe some one have package? I need all in one

09 Apr
2 years ago

Waldemar started a new conversation Packages For Project

Hello! Please advise packages for the site

  1. Users extended (confirm email) + social accounts
  2. ACL
  3. Google analytics (charts)
  4. Postst rating
  5. Email app with Laravel (connect gmail acc)
  6. Gmail calendar

Can still some interesting packages?

13 Mar
2 years ago

Waldemar left a reply on Laravel Admin Panel

I need from laravel admin panel just a roles users, authenticate, user online and pretty dashboard =)

Waldemar left a reply on Laravel Admin Panel

@jlrdw You mean to write yourself an admin panel?

Waldemar started a new conversation Laravel Admin Panel

Hello! Who and what admin panel uses? Alternative backpack

16 Feb
2 years ago

Waldemar left a reply on Valet PHP

@tykus YES

➜  ~ brew install php70
Warning: homebrew/php/php70-7.0.15_8 already installed

Waldemar left a reply on Valet PHP

yes

Waldemar started a new conversation Valet PHP

Hello! I have a problem with php. When i install php 7

php -v

PHP is correct after install version 7 but when i reboot Mac PHP still is old PHP 5.5.36 What i do is wrong?

30 Dec
2 years ago

Waldemar left a reply on Filtered Data With Pagination

This is my decision

$products = Products::join('values', 'products.id', '=', 'values.product_id')->where('kind_id', $kind->id)->where(function($query){
                $brands = Input::has('brands') ? Input::get('brands') : null;
                $cokol = Input::has('cokol') ? Input::get('cokol') : null;
                $cvet = Input::has('cvet') ? Input::get('cvet') : null;

                if(isset($brands))
                {
                    foreach ($brands as $brand) {
                        $query->where('producer_id', '=', $brand);
                    }
                }
                if(isset($cokol))
                {
                    foreach ($cokol as $cok) {
                        $query->where('values.value_4', '=', $cok);
                    }
                }
                if(isset($cvet))
                {
                    foreach ($cvet as $cv) {
                        $query->where('values.value_9', '=', $cv);
                    }
                }
            })->orderBy('product_order', 'desc')->paginate(12);

Waldemar left a reply on Filtered Data With Pagination

@SaeedPrez

No its a different table values i need sort products where value_4 = input::get(filter value)

Waldemar left a reply on Filtered Data With Pagination

@SaeedPrez Ok its work! But i need add sort values relationship

model Products

 public function value()
    {
        return $this->hasOne('App\Values', 'product_id');
    }