copain

Experience

2,660

0 Best Reply Awards

  • Member Since 9 Months Ago
  • 16 Lessons Completed
  • 0 Favorites

8th August, 2018

copain started a new conversation Notification Using Ajax. • 2 months ago

Hello i have a Laravel project and i'm looking for easy way to create notification, in my project i have announcement table and i want all user will see notification every-time there is new announcement. is it possible? without using pusher or echo? can AJAX make this possible? if you have any idea or link for tutorial i would appreciate thanks in advance.

6th August, 2018

copain started a new conversation How To Redirect Notification To Post_id • 2 months ago

Hello i'm trying to create notification everytime there is a new post ,when they click one of the notification link it will re direct to the post and show the post, is it possible without using vue.js

here is my code;

Controller:
  public function readbyid(Notification $notification){

 Auth::user()->unreadnotifications()->find($request->id)->markAsRead();
        return redirect()->back();
}


Route:

Route::get('markread/{notification}', '[email protected]' ); 


View Blade:

 @foreach(auth()->user()->unreadnotifications as $notify)
                    <li><a rel="nofollow" href="{{Url('notification/')}}" class="dropdown-item d-flex"> 
                    
                        <div class="msg-body">
                        <h3 class="h5">{{$notify->data['title']}}</h3>
                        </div> </a></li>@endforeach

right now with my code i cannot view the post,

11th July, 2018

copain started a new conversation Editing Data Table In Laravel Confuse • 3 months ago

i have this data-table in my project, now i want to perform update/edit in my table is it necessary to use java-script or any data-grid plugin in order for me to edit my table? or i can simple just use input html and pass it to my controller is it possible? cos i'm a little bit confuse..if im wrong please point me to a better solution if could provide link tutorial that would be awesome. attached link to my question in stackoverflow

https://stackoverflow.com/questions/51296406/editing-data-table-in-laravel-confuse

3rd July, 2018

copain left a reply on Laravel 5.5 Pagination For Bootstrap 4 • 3 months ago

@roddyp youre answer works thank you... i was using bootstrap 3 in laravel but when i shifted to bootstrap 4 pagination come out ugly then i came across with your'e answer then it works hehe Thank you..

27th June, 2018

copain left a reply on Foreach Loop To Array • 3 months ago

@BishoyWagih this is working but problem is i'm getting null value.

copain left a reply on Foreach Loop To Array • 3 months ago

@BishoyWagih will i still follow my previous code or just simply replace it with your code?

copain started a new conversation Foreach Loop To Array • 3 months ago

with my current code i can only store 1 value at a time is there anyway that i could make this array? i use for-each loop hoping it will loop all the value and send it as array, but not working can anyone point me to a Laravel tutorial discussing on how to perform loop to array..

Note: my model Score has foreign key which is [Lead_id and Subject_id]

Controller code:

$data = $request->all();

        $leads = $data['Lead_id'];
    
        $subject_ids = $data['Subject_id'];
    
        foreach($leads as $key => $input) {

        $scores = new Score();
        $scores->Subject_id = isset($subject_ids[$key]) ?  $subject_ids[$key] : ''; 
        $scores->Lead_id = isset($leads[$key]) ? $leads[$key] : ''; 
        $scores->save();
      }

13th June, 2018

copain left a reply on How To Perform Simple Audit Trail In Simple CRUD Laravel • 4 months ago

@bobbybouwmann thanks for you're answer man, i have found a package in laravel named LARAVEL-AUDIT and this is what i was looking for full package of audit trail easy to use hehe but anyways thank you appreciate you're answer..

copain started a new conversation How To Perform Simple Audit Trail In Simple CRUD Laravel • 4 months ago

how to get the username of the last person who update the form,using the (updated_at) timestamp in laravel and what is the best logic or approach to do?is it possible to use in blade only? or should i need to put the code in my controller?

Example: Updated:13-Jun-2018 UpdatedBy: Username

currently i can only get the updated date by using this code in my blade

Updated:{{ date('d-M-Y', strtotime($leads->updated_at))}}

9th June, 2018

copain left a reply on Date Search In Laravel 5.5 • 4 months ago

@bobbybouwmann @Cronix ronix if i use the parseFromFormat it Doesn't work its showing timezone problem. But when i use Parse and removed the 'y-d-m' it worked but when i run search again in may april will show on the last page haha but when i search other month it works no issue.. mybe my may data is a bit problem haha but anyways thanks man ill just have to delete my may data and see if

copain left a reply on Date Search In Laravel 5.5 • 4 months ago

@bobbybouwmann i used your'e suggested code it only works if i remove the 'Y-m-d' but i ran into another problem if i search (From May 1 To May31) April also come out in the table haha

8th June, 2018

copain started a new conversation Date Search In Laravel 5.5 • 4 months ago

i have a table with 3 search functions, [1.search box, 2.drop-down 3. date-picker] now i'm having problem with (date-picker) how do i make it work inside my controller i want to have like Date_From and Date_To so i can filter the date, but in my DB i only have the default timestamp which is the created_at column is it possible to use it? and how?

Note: Search box and drop down search is working fine with this code, all i need is the code for date search and where to put it inside my controller and blade.

`` CONTROLLER: public function index(Request $request) {

    $search=$request->input('search'); 
  

    if(request()->has('lead_status')){
        $leads=Lead::where('lead_status', request('lead_status'))
        ->paginate(5)
        ->appends('lead_status',request('lead_status'));
    }

    else{

        $leads=Lead::orderBy('created_at','desc')->search($search)->paginate(5);
  
    }

    return  view ('leads.index')->with('leads',$leads);

}

``

View.Blade

``

<input type="text" name="search" class="form-controll" placeholder="Enter Name" value=" 
{{isset($search) ? $search : ''}}" style="text-transform:uppercase;" >

</div>

<div class="form-group">

<button type="submit"><i class="fa fa-search"></i></button>

</div>
<!--End Search Box -->

 <!--Start Drop Down Filter -->

<div class="form-group">
 <div class="dropdown">
    <button class="dropbtn">Select Status <i class="fa fa-caret-down"></i></button>
      <div class="dropdown-content">
      <a href="/leads?lead_status=enrolled">ENROLLED</a>
      <a href="/leads?lead_status=pending">PENDING</a>
      <a href="/leads?lead_status=cancel">CANCEL</a>
       
  </div>
<!--End Drop Down Filter -->
FROM
<label>TO</label>

</form>

``

9th April, 2018

copain started a new conversation Customizing Reset Password For Laravel • 6 months ago

Hello, any tutorial Link on how to create custom password reset in Laravel? i want to have a reset password on my web application but i don't want to use the email reset. is it possible?

i want something like this:

Username: OldPassword: NewPassword: ConfrimPassword:

25th March, 2018

copain left a reply on Loop And Array In La-ravel • 6 months ago

@jlrdw No bro i don't need to create separate table i only have parents table, now my question is it possible?

copain started a new conversation Loop And Array In La-ravel • 6 months ago

I have a student registration form, when you enroll your'e child you fill up the form then inside the form has information about the father like name, occupation,email and etc.. then inside the form also you can put your'e child's name, age gender etc .. now if you have multiple child you can click the + button to add another row for the second child then once you submit the form the two child you key-in will have the same father's information.

Question: how do i construct it into my Controller? and how do i loop the parent's information. Currently with my code i can only save array of child information i can't loop the father's information in each child.

Controller:

 public function store(Request $request)
    {
    //dd($request->all());
    
                $this->validate($request, [
                     'student_name.*'=>'required|max:50',
                      'age.*'=>'required|integer',
                   //Roles Goes Here 
                 ]);
                 
                 $input = $request->all();

                 if (count($input['student_name']) > 0) {
                     for ($i = 0 ; $i < count($input['student_name'])  ; $i++) {
                            $leads = new Lead();
         
                           $leads->student_name = $input['student_name'][$i];
                           $leads->gender =  $input['gender'][$i];
                           $leads->age = $input['age'][$i];

                           $leads->father_name=$request->father_name;
                           $leads->father_contact1=$request->father_contact1;
                           $leads->father_email=$request->father_email;
                           $leads->father_occupation=$request->father_occupation;
                           $leads->father_religion=$request->father_religion;
                           
                           $leads->save();
                     }
                 
}

VIEW

<form action="{{route('leads.store')}}" method="POST">
    {{csrf_field()}}
    
    <div class="col-sm-12">
    <h3 class="well">Parent's Information</h3>
    <div class="row">
        

        <div class="col-sm-4 form-group">
        <label>FATHER'S NAME</label>                    
        <input class="form-control" id="txtuppercase1"  type="text" name="father_name" value="{{old('father_name')}}" placeholder="Enter FATHER NAME.." >                       
        </div>

        <div class="col-sm-4 form-group">
        <label>CONTACT</label>
        <input type="text" id="txtuppercase2"   name="father_contact1" value="{{old('father_contact1')}}" placeholder="Enter CONTACT.." class="form-control"  >
        </div>
        <div class="col-sm-4 form-group">

        <label>EMAIL ADDRESS</label>
        <input type="text"    name="father_email" value="{{old('father_email')}}" placeholder="Enter EMAIL ADDRESS.." class="form-control"  >
        </div>

        <div class="col-sm-4 form-group">
        <label>OCCUPATION</label>
        <input type="text"   name="father_occupation" value="{{old('father_occupation')}}" placeholder="Enter OCCUPATION.." class="form-control"  >
        </div>

        <div class="col-sm-4 form-group">
        <label>RELIGION</label>
        <input type="text"   name="father_religion" value="{{old('father_religion')}}" placeholder="Enter RELIGION.." class="form-control"  >
        </div>

    </div>
    <br>
    <div class="row">
        <div class="col-md-12">
            <div data-role="dynamic-fields">
                <div class="form-inline">
                    <div class="form-group">
                        <label class="sr-only" for="student_name">NAME</label>
                        <input type="text" class="form-control" id="student_name"  name="student_name[]" placeholder="STUDENT NAME">
                    </div>
                    <span>-</span>
                    <div class="form-group">
                        <label class="sr-only" for="age">AGE</label>
                        <input type="text" class="form-control" id="age"  name="age[]" placeholder="AGE">
                    </div>
                    <span>-</span>
                    
                    <div class="form-group">
                        
                        <label class="sr-only" for="gender">GENDER</label>
                        <input type="text" class="form-control" id="gender"  name="gender[]" placeholder="GENDER">
                    </div>
                    <span>-</span>
                    
                    <div class="form-group">
                        
                        <label class="sr-only" for="school">SCHOOL</label>
                        <input type="text" class="form-control" id="last_school_attended"  name="last_school_attended[]" placeholder="SCHOOL">
                    </div>
                    <button class="btn btn-danger" data-role="remove">
                        <span class="glyphicon glyphicon-remove"></span>
                    </button>
                    <button class="btn btn-primary" data-role="add">
                        <span class="glyphicon glyphicon-plus"></span>
                    </button>
                </div>  <!-- /div.form-inline -->
            </div>  <!-- /div[data-role="dynamic-fields"] -->
        </div>  <!-- /div.col-md-12 -->
    </div>  <!-- /div.row -->

      <br>    
<div>
<button type="submit" class="btn btn-success">SUBMIT</button>
<a href="{{route('leads.index')}}" class="btn btn-success">CANCEL</a>
</div>
 </form>

22nd March, 2018

copain left a reply on How To Execute Loop With Array • 6 months ago

@Snapey im getting error

Invalid argument supplied for foreach()

copain left a reply on How To Execute Loop With Array • 6 months ago

@Snapey no need for relationship, cos it stays in single table only, this is a student registration form when you enroll your'e child you fill up the form then inside the form has information about the father like name, occupation,email and etc.. then inside the form also you can put your'e child's name, age gender etc .. now if you have multiple child you can click the + button to add another row for the second child then once you submit the form the two child you key in has the same father's information.

copain left a reply on How To Execute Loop With Array • 6 months ago

@Snapey What do u need?

copain left a reply on How To Execute Loop With Array • 6 months ago

@Snapey can do a sample base on my controller above?

copain started a new conversation How To Execute Loop With Array • 6 months ago

i have a form where you enter the parent information together with the child information now how do i save if one parent with multiple child.

Example:

FATHER (A) has child1,child2,child3 how do i loop this,

CONTROLLER:

public function store(Request $request)
    {
     
    
                $this->validate($request, [
                     'student_name.*'=>'required|max:50',
                      'age.*'=>'required|integer',
                  
                 ]);

                           /*$leads = new Lead();
                           
                           $leads->save();*/
               


                 $input = $request->all();

                 if (count($input['student_name']) > 0) {
                     for ($i = 0 ; $i < count($input['student_name'])  ; $i++) {
                           $leads = new Lead();
                           $leads->student_name = $input['student_name'][$i];
                           $leads->gender =  $input['gender'][$i];
                           $leads->age = $input['age'][$i];
                           $leads->last_school_attended = $input['last_school_attended'][$i];

                           $leads->father_name=$request->father_name;
                           $leads->father_contact1=$request->father_contact1;
                           $leads->father_email=$request->father_email;
                           $leads->father_occupation=$request->father_occupation;
                           $leads->father_religion=$request->father_religion;

                           $leads->save();
                     }
                 }
                
                

                //Display a successful message upon save
                return redirect()->route('leads.index')
            ->with('flash_message', 'Success.');
    }

VIEW:

<form action="{{route('leads.store')}}" method="POST">
    {{csrf_field()}}
    
    <div class="col-sm-12">
    <h3 class="well">Parent's Information</h3>
    <div class="row">
        

        <div class="col-sm-4 form-group">
        <label>FATHER'S NAME</label>                    
        <input class="form-control" id="txtuppercase1"  type="text" name="father_name" value="{{old('father_name')}}" placeholder="Enter FATHER NAME.." >                       
        </div>

        <div class="col-sm-4 form-group">
        <label>CONTACT</label>
        <input type="text" id="txtuppercase2"   name="father_contact1" value="{{old('father_contact1')}}" placeholder="Enter CONTACT.." class="form-control"  >
        </div>
        <div class="col-sm-4 form-group">

        <label>EMAIL ADDRESS</label>
        <input type="text"    name="father_email" value="{{old('father_email')}}" placeholder="Enter EMAIL ADDRESS.." class="form-control"  >
        </div>

        <div class="col-sm-4 form-group">
        <label>OCCUPATION</label>
        <input type="text"   name="father_occupation" value="{{old('father_occupation')}}" placeholder="Enter OCCUPATION.." class="form-control"  >
        </div>

        <div class="col-sm-4 form-group">
        <label>RELIGION</label>
        <input type="text"   name="father_religion" value="{{old('father_religion')}}" placeholder="Enter RELIGION.." class="form-control"  >
        </div>

    </div>
    <br>
    <div class="row">
        <div class="col-md-12">
            <div data-role="dynamic-fields">
                <div class="form-inline">
                    <div class="form-group">
                        <label class="sr-only" for="student_name">NAME</label>
                        <input type="text" class="form-control" id="student_name"  name="student_name[]" placeholder="STUDENT NAME">
                    </div>
                    <span>-</span>
                    <div class="form-group">
                        <label class="sr-only" for="age">AGE</label>
                        <input type="text" class="form-control" id="age"  name="age[]" placeholder="AGE">
                    </div>
                    <span>-</span>
                    
                    <div class="form-group">
                        
                        <label class="sr-only" for="gender">GENDER</label>
                        <input type="text" class="form-control" id="gender"  name="gender[]" placeholder="GENDER">
                    </div>
                    <span>-</span>
                    
                    <div class="form-group">
                        
                        <label class="sr-only" for="school">SCHOOL</label>
                        <input type="text" class="form-control" id="last_school_attended"  name="last_school_attended[]" placeholder="SCHOOL">
                    </div>
                    <button class="btn btn-danger" data-role="remove">
                        <span class="glyphicon glyphicon-remove"></span>
                    </button>
                    <button class="btn btn-primary" data-role="add">
                        <span class="glyphicon glyphicon-plus"></span>
                    </button>
                </div>  <!-- /div.form-inline -->
            </div>  <!-- /div[data-role="dynamic-fields"] -->
        </div>  <!-- /div.col-md-12 -->
    </div>  <!-- /div.row -->

      <br>    
<div>
<button type="submit" class="btn btn-success">SUBMIT</button>
<a href="{{route('leads.index')}}" class="btn btn-success">CANCEL</a>
</div>
 </form>


21st March, 2018

copain left a reply on Save Value Of An Array • 6 months ago

@zymawy thanks bro, it works .

copain left a reply on Save Value Of An Array • 6 months ago

@Dry7 if i delete validation it how do i required the field

copain left a reply on Save Value Of An Array • 6 months ago

@Dry7 so i don't need to touch my controller? jus tuse this in my model..

copain started a new conversation Save Value Of An Array • 6 months ago

how do i save the value of array into my controller?

result of array

  dd($request->all());

array:4 [▼
  "_token" => "kjYvkKfuOkiBacn1EC0EzfeK5AitRYbXADE2E5RI"
  "student_name" => array:3 [▼
    0 => "ROBERT"
    1 => "cindy"
    2 => "rico"
  ]
  "age" => array:3 [▼
    0 => "12"
    1 => "13"
    2 => "14"
  ]
  "gender" => array:3 [▼
    0 => "MALE"
    1 => "female"
    2 => "MALE"
  ]
]

CONTROLLER:

public function store(Request $request)
    {
     dd($request->all());
    
        $this->validate($request, [
         
          'student_name'=>'required|max:50',
            
            
                ]);
               
           
                
                        $leads=new Lead();
                        $leads->student_name = $request->student_name;
                       $leads->gender = $request->gender;
                       $leads->age = $request->age;
                       $leads->save();
                    
                
                

                //Display a successful message upon save
                return redirect()->route('leads.index')
            ->with('flash_message', 'Success.');
    }

20th March, 2018

copain left a reply on How Do I Save Multiple Value Of A Fillable Table Into My Database • 6 months ago

@vmitchell85 bro its not working, here is the update code.

CONTROLLER:

public function store(Request $request)
    {
        $this->validate($request, [
         
        
            
            'student_name'=>'required|max:50|unique:leads,student_name',
            
            
                ]);
               
                foreach($request->all() as $leads => $value) {
                    if (starts_with('name', $leads)) {
                        $number = str_after('name', $leads);
                
                        $leads=new Lead();
                        $leads->student_name = $request->input('name' . $number);
                        $leads->gender = $request->input('gender' . $number);
                        $leads->age = $request->input('age' . $number);
                        $leads->save();
                    }
                }
              

                //Display a successful message upon save
                  return redirect()->route('leads.create')
                      ->with('flash_message', 'Success.');
    }



VIEW


<div class="row">
    <form action="{{route('leads.store')}}" method="POST">
    {{csrf_field()}}
    
    <div class="col-sm-12">
    
    
<div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-bordered table-hover" id="tab_logic">
                <thead>
                    <tr >
                        <th class="text-center">
                            #
                        </th>
                        <th class="text-center">
                            STUDENT NAME
                        </th>
                        <th class="text-center">
                            GENDER
                        </th>
                        <th class="text-center">
                            AGE
                        </th>
                        <th class="text-center">
                            SCHOOL
                        </th>
                        
                    </tr>
                </thead>
                <tbody>
                
                    <tr id='addr0'>
                        <td>
                        1
                        </td>
                        <td>
                        <input type="text" name='student_name0' value="{{old('student_name')}}" placeholder='STUDENT NAME' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='gender0' placeholder='GENDER' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='age0'  placeholder='AGE' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='school0' placeholder='SCHOOL' class="form-control"/>
                        </td>
                    </tr>
                    
                    <tr id='addr1'></tr>
                </tbody>
            </table>
        </div>
    </div>
    <a id="add_row" class="btn btn-default pull-left">Add Row</a><a id='delete_row' class="pull-right btn btn-default">Delete Row</a>
    
          
<div>
<button type="submit" class="btn btn-success">SUBMIT</button>
<a href="{{route('leads.index')}}" class="btn btn-success">CANCEL</a>
</div>
    </form>


<!--end of container-->
 </div>
 </div>

copain left a reply on How Do I Save Multiple Value Of A Fillable Table Into My Database • 6 months ago

@vmitchell85 bro i'm confused about this $number $label shall i leave it as it is? or changed it?

copain left a reply on How Do I Save Multiple Value Of A Fillable Table Into My Database • 6 months ago

@vmitchell85 bro try the sample link: here https://bootsnipp.com/snippets/featured/dynamic-table-row-creation-and-deletion

then tell me how to save the value at once..

copain started a new conversation How Do I Save Multiple Value Of A Fillable Table Into My Database • 6 months ago

i have a fallible table and i want to save the value of the table into my database at one but i don't know to loop it any idea how?

Controller:

public function store(Request $request)
{
    $this->validate($request, [

        'student_name'=>'required|max:50|unique:leads,student_name',
        'gender'=>'required|max:50',
        'age'=>'required|max:2',



            ]);

            $leads=new Lead();
            $leads->student_name = $request->student_name;
            $leads->gender = $request->gender;
            $leads->age = $request->age;
            $leads->save();

            //Display a successful message upon save
              return redirect()->route('leads.create')
                  ->with('flash_message', 'Success.');
}

CREATE.BLADE

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-bordered table-hover" id="tab_logic">
                <thead>
                    <tr >
                        <th class="text-center">
                            #
                        </th>
                        <th class="text-center">
                            StudentName
                        </th>
                        <th class="text-center">
                            Gender
                        </th>
                        <th class="text-center">
                            Age
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr id='addr0'>
                        <td>
                        1
                        </td>
                        <td>
                        <input type="text" name='student_name'  placeholder='StudentName' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='gender' placeholder='Gender' class="form-control"/>
                        </td>
                        <td>
                        <input type="text" name='age' placeholder='AGE' class="form-control"/>
                        </td>
                    </tr>
                    <tr id='addr1'></tr>
                </tbody>
            </table>
        </div>
    </div>
    <a id="add_row" class="btn btn-default pull-left">Add Row</a><a id='delete_row' class="pull-right btn btn-default">Delete Row</a>
</div>

16th March, 2018

copain started a new conversation How To Avoid Url Address Manipulation • 7 months ago

in laravel how do i stop my url address from showing data everytime i changed the id example below.

Example: http://localhost:8000/posts/11 --DEFAULT

If they change the id like the example below it will return to the DEFAULT or go to forbidden page. http://localhost:8000/posts/12

http://localhost:8000/posts/13

http://localhost:8000/posts/14

copain left a reply on Report Designer For Laravel 5.5 • 7 months ago

@xmarks yes i wan to generate report Example: Emplyee Information in one page like resume where you can see all the information of one particular person..

copain left a reply on Auto Increment Integer • 7 months ago

@jessica thank you..

15th March, 2018

copain started a new conversation Report Designer For Laravel 5.5 • 7 months ago

Hello, any suggestion or available link tutorial for how to make or design report in Laravel 5.5 i'm new in programming hope that you could point me into right direction. i wanna know how to make it. thanks in advance..

14th March, 2018

copain started a new conversation Auto Increment Integer • 7 months ago

i'm trying to make integer as auto increment and want to start in 100, but error keep coming up..

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and i
 t must be defined as a key

My code:

   public function up()
    {
        Schema::create('leads', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('generate_id');
            $table->string('name')->nullable();
            $table->string('office_number')->nullable();
            $table->string('father_email')->nullable();
            $table->string('father_occupation')->nullable();
            $table->string('father_religion')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('leads');
    }
}

13th March, 2018

copain left a reply on Auto Increment String • 7 months ago

@snapey @Cronix @jlrdw thanks guys your idea and opinions helped me understand how make it more easy and simple without scratching my head :D

copain left a reply on Auto Increment String • 7 months ago

@Cronix your code shall i put it on the controller or in the view.blade?

this is my code in controller

`public function store(Request $request) { // $this->validate($request, [

       'generate_id'=>'required|Unique',


        ]);
        $leads=new lead();
        $leads->generate_id=$request->generate_id;
        $leads->name=$request->name;
        $leads->save();

        return redirect()->route('leads.index')
    ->with('flash_message', 'Success.');

}`

copain left a reply on Auto Increment String • 7 months ago

@Cronix i want something like AAA001,AAA002,AAA003 is it posible?

copain started a new conversation Auto Increment String • 7 months ago

how do i create auto increment string in laravel and store it into mysql database?

MIGRATION TABLE.

public function up() { Schema::create('leads', function (Blueprint $table) { $table->increments('id'); $table->string('generate_id'); $table->string('name')->nullable(); $table->timestamps(); }); }

CONTROLLER:

public function store(Request $request) { // $this->validate($request, [

       'generate_id'=>'required|Unique',


        ]);
        $leads=new lead();
        $leads->generate_id=$request->generate_id;
        $leads->name=$request->name;
        $leads->save();

        return redirect()->route('leads.index')
    ->with('flash_message', 'Success.');

}

29th December, 2017

copain started a new conversation Auto Checked Checkbox Value Using Vue.js • 9 months ago

On my edit page I'm trying to make my checkbox auto checked based on the permissions that I already assigned to my roles, I don't know how to make it work. Any idea? Currently with my code I'm getting unchecked checkbox with the list of all my permissions

Edit.blade

@foreach ($permissions as $permission) {{$permission->display_name}} @endforeach

var app = new Vue({ el: '#app', data: { permissionsSelected: [] } });

19th December, 2017

copain started a new conversation Checkbox Won't Show Using Buefy In Laravel • 9 months ago

Hello, i have been trying to display a check box but i couldn't get it to display, I've tried some of the tutorials and read other forum but still couldn't make it to work, if anyone could guide me to the proper way on how to make (buefy+bulma ) Checkbox work, i would appreciate your help. i'm only trying to display simple check box. below are the following materials i have.

1.#App.js

require('./bootstrap');

window.Vue = require('vue');

import Vue from 'vue' import Buefy from 'buefy' import 'buefy/lib/buefy.css'

Vue.use(Buefy)

const app = new Vue({ el: '#app' });

2.# index.blade.php

@extends('layouts.appmain')

@section('content')

<div class="column">

<div class="block">
        <b-checkbox v-model="checkboxGroup"
            native-value="test1">
            TEST1
        </b-checkbox>
        <b-checkbox v-model="checkboxGroup"
            native-value="test2">
            TEST2
        </b-checkbox>
        <b-checkbox v-model="checkboxGroup"
            native-value="test3">
            TEST3
        </b-checkbox>
    </div>
  </div>

    <script src="{{ asset('assets/js/app.js') }}"></script>

@endsection

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.