xuuto

xuuto

Member Since 3 Years Ago

Experience Points
3,180
Total
Experience

1,820 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
20
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
3,180 XP
Nov
07
3 months ago
Activity icon

Replied to Laravel How To Use View Composers To Build Something Like Widgets

yeah. i have got the idea, and once, i have contacted one of my mentors, who i canot contact now, he told me that he build website using laravel with this following database schema, i think he told me that website was a news web, that had static and dynamic widgets,

and this is the Db SCHEMA he sent me to use, although i cannot figure out how i could but together using blade files..

databases:
menus: id, name, parent[integer=list of menus], type[enum=section, static, article, url]
statics: id, title, image, content
sections: id, title, description 
widgets: id, type[artcles, static, video, gallery], page[section to appear], ordering[smallint], articles[list, optional, video, gallery, code]
articles: id, title, image, content, section_id

and this is how he told me to use blade files, that i want to be explained in detail.

Views:
home.blade.php
page.blade.php  is for sections
widgets.blade.php    this will be included in page.blade and is responsible for Type of widget for that page. 

Suppose, that page has static widget or widget  showing displaying top 5 articles , or a widget displaying latest 5 articles, or widget displaying video. Of course you should make a separate view for each one.

static.blade.
article.blade

that is what he sent me as i translated into english, i think this makes sense, but somehow i think i cannot figure out how exaclty i can include files and how ordering works.

thanks in advance, i really appreciate if you could give me a detailed info how exactly it can be but together to make dynamic widgets.

thanks once more

Activity icon

Replied to Laravel How To Use View Composers To Build Something Like Widgets

what about if i want, use something like, WYSIWYG Editor, inorder to save that content into db. and set position, by making some relation with dynamic widget queries, like, most read articles, latest 10 articles, trending articles of this week etc,

Activity icon

Started a new Conversation Laravel How To Use View Composers To Build Something Like Widgets

HI, i would like to help me with, how i could accomplish something like widgets of sidebar, that widgets should consist of dynamic and static, i know it is simple to create dynamic by using view composers, by querying db and passing result the page(s), you want.

but what i want is, how i could also list static content, and dynamic content in the sidebar, for example, 5 top most read articles, and a static content, saying, we are hiring a developer,,,,,,

i want to know the most, accurate way that can be accomplished

i think u got my point.

Oct
28
3 months ago
Activity icon

Replied to Laravel Vuejs, I Have A Status Field, That Determines If A Minister Is Published Or Not, I Want To Show Published If It Is Published Or Unpublished, It Is Not Working In My V-for Loop

yeah. thanks, that is what i wanted, it really worked like this,

<td>{{ minister.status ? 'published' : 'unplished' }} </td>

i had a status, field, which i casted to boolean, it returns true or false if it is published true, and if not, false.

Thanks

Oct
27
3 months ago
Activity icon

Started a new Conversation Laravel Vuejs, I Have A Status Field, That Determines If A Minister Is Published Or Not, I Want To Show Published If It Is Published Or Unpublished, It Is Not Working In My V-for Loop

here is my ministers.vue file

 <div class="card-body table-responsive p-0">
                        <table class="table table-hover">
                            <tbody>
                            <tr>
                                <th>ID</th>
                                <th>Name</th>
                                <th>Status</th>
                                <th>Created</th>
                                <th>Modify</th>
                            </tr>
                            <tr v-for="minister in ministers" :key="minister.id">
                                <td>{{ minister.id }}</td>
                                <td>{{ minister.name }}</td>
                                <td>  {{activeMinisters}}</td>

                                <!--<td>{{ minister.status }}</td>-->
                                <td>{{ minister.created_at }}</td>
                                <td>
                                    <a href="#" @click="editModal(minister)">
                                        <i class="fa fa-edit blue"></i>
                                    </a>
                                    /
                                    <a href="#" @click="deleteMinister(minister.id)">
                                        <i class="fa fa-trash red"></i>
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>

js section

<script>
    export default {
        data(){
           return{
               ministers: {},
               checked: 1,
               form: new Form({
                   name: '',
                   description: '',
                   image: '',
                   status: '',
                   admin_id: '',
               })
           }
        },
        computed: {
          activeMinisters: function() {
              return this.ministers.filter(function(m) {
                  return m.active
              })
          }
        },
        methods: {
          loadMinisters(){
                  axios
                      .get('/api/ministers').then(({data}) => {
                      this.ministers = data.data;
                  })
                  .catch(error => {
                    console.log(error)
                })
          },
          createMinister(){
              this.form.post('api/minister');
          },
        },
        created() {
           this.loadMinisters();
        }
    }
</script>

Sep
17
5 months ago
Activity icon

Started a new Conversation Laravel Vuejs Using Vuejs Using Vform How To Show Loading Spinner While Login In

what i want is i want to show the user logging in spinner while login in in my laravel forent end user login, using bootstrap 4 modal popup. it works. but what i want is to show the user logging in spinner.

<script>
    export default {
        data() {
            return {
                form: new Form({
                    email: '',
                    password: '',
                    remember: false
                })
            }
        },

        computed: {
            isValidLoginForm(){
                return this.emailIsValid() && this.form.password
            }
        },

        methods: {
            emailIsValid(mail) {
                if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.form.email)) {
                    return (true)
                } else {
                    return false
                }
            },
            login(){
                //submit the form via a post request
                this.form.post('/member/login')
                    .then(({data}) => location.reload())
                    // .location.reload()

                    // .catch(error => )
            }
        },
        mounted() {
            console.log('Component mounted.')
        }
    }
</script>

Sep
06
5 months ago
Activity icon

Replied to How To Make Laravel 5.8 Login And Register Ajax Jquery Without Refresh Modal Popup

what about showing spinner while logging in?

Activity icon

Started a new Conversation How To Make Laravel 5.8 Login And Register Ajax Jquery Without Refresh Modal Popup

i need to make an ajax login and register laravel 5.8 and bootstrap 4 modal popup, without reloading current page, showing, an ajax spinner.

Aug
27
5 months ago
Activity icon

Replied to Laravel 5.8 Admin And Member Logout Error.

yeah it is working as you mentioned when i used post. thanks..

Activity icon

Replied to Laravel 5.8 Admin And Member Logout Error.

yeah it uses form submit botton post. like shown below.

<li class="nav-item">
                <a class="nav-link" href="{{ route('admin.logout') }}"
                   onclick="event.preventDefault();
                                                     document.getElementById('logout-form').submit();">
                    <i class="nav-icon fas fa-user"></i>
                    <p>{{ __('Logout') }}</p>
                </a>

                <form id="logout-form" action="{{ route('admin.logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            </li>
Activity icon

Replied to Laravel 5.8 Admin And Member Logout Error.

so you mean for example as my admin logout is using get like this.

Route::get('admin/logout', 'Auth\[email protected]')->name('admin.logout');

i should change like this this using post method.

Route::post('admin/logout', 'Auth\[email protected]')->name('admin.logout');
Activity icon

Replied to Laravel 5.8 Admin And Member Logout Error.

my logout routes were already using get method. but as you can see below i have two different auth gguards which are 'Member guard and Admin guard' i can login as admin and i can also login as member. but the problem is when ever i try to logout both of them i get that error. i donot even know what the exact problem is .

Sometimes it works for example when i turned on my laptop now. and run the phpstorm i logged in as admin, while loggid as admin i also logged in as member, but when i try to loguot i get that error. that is the problem.

Auth::routes();

Route::get('/home', '[email protected]')->name('home');

Route::get('/member/login', 'Auth\[email protected]')->name('login');
Route::post('/member/login', 'Auth\[email protected]')->name('member.login');
Route::get('/member/logout', 'Auth\[email protected]')->name('logout');
// registration routes
Route::get('register', 'Auth\[email protected]')->name('register');
Route::post('register', 'Auth\[email protected]');
Route::get('member/dashboard', 'Auth\[email protected]')->name('member.dashboard');

//admin routes.
Route::get('admin/login', 'Auth\[email protected]')->name('admin.login');
Route::post('admin/login', 'Auth\[email protected]')->name('admin.login.submit');
Route::get('admin/logout', 'Auth\[email protected]')->name('admin.logout');
Route::get('admin/dashboard', 'Auth\[email protected]')->name('admin.dashboard');

//backend controllers
//Route::resource('ministers', 'MinisterController');
Route::group(['middleware' => ['auth:admin_user']], function (){
   Route::resource('ministers', 'MinisterController');
});

and this is the error as i posted before

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
The POST method is not supported for this route. Supported methods: GET, HEAD.

Aug
26
5 months ago
Activity icon

Started a new Conversation Laravel 5.8 Admin And Member Logout Error.

when i try to logout admin it throws Symfony \ Component \ HttpKernel \ Exception \

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
The POST method is not supported for this route. Supported methods: GET, HEAD.
Aug
19
6 months ago
Activity icon

Replied to Laravel 5.8 Custom Auth Registration Method Doesnot Login Returns Back To Same Form

yeah. you really got the point that it was validation error ,,

I really managed to fix the validation because i had a username field in my migration but not name, as you can see i was saving name in create method. That was the problem..

Many thanks @snapey

Aug
16
6 months ago
Activity icon

Started a new Conversation Laravel 5.8 Custom Auth Registration Method Doesnot Login Returns Back To Same Form

i was building a custom member registration authentication system with laravel 5.8. but when i fill out the form and click on register it redirects back to the same form with out any error and doesnot login.

and this is my memberRegistrationController

<?php

namespace QaranKaab\Http\Controllers\Auth;

use QaranKaab\Member;
use QaranKaab\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Auth\Events\Registered;


class MemberRegisterController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Register Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users as well as their
    | validation and creation. By default this controller uses a trait to
    | provide this functionality without requiring any additional code.
    |
    */

    use RegistersUsers;

    /**
     * Where to redirect users after registration.
     *
     * @var string
     */
    protected $redirectTo = '/';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest:member');
    }

    /**
     * Show the application registration form.
     *
     * @return \Illuminate\Http\Response
     */
    public function showRegistrationForm()
    {
        return view('frontend.auth.member_register');
    }


    public function register(Request $request)
    {
        $this->validator($request->all())->validate();
        $member = $this->create($request->all());
        $this->guard()->login($member);
        return redirect($this->redirectTo);

    }

    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:members'],
            'password' => ['required', 'string', 'min:8', 'confirmed'],
        ]);
    }

    protected function create(Request $request)
    {

       return Member::create([
            'name' => $request['name'],
            'email' => $request['email'],
            'password' => Hash::make($request['password'])
        ]);

    }



    protected function guard()
    {
        return Auth::guard('member');
    }


}