Flex

Experience

930

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

22nd June, 2017

Flex left a reply on How To Validate (check) Data Table Values Befour Data Insert In Laravel 5.2 • 3 days ago

I found some solutions

  $duplicate = Project::where('project_name',$project->project_name)->first();
        if($duplicate)
        {
            return redirect()->route('projects.index')->with('warning','Title already exists');
        }   

Flex left a reply on How To Validate (check) Data Table Values Befour Data Insert In Laravel 5.2 • 3 days ago

@Boris following error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'where clause' (SQL: select count(*) as aggregate from `projects` where `name` = ffffff)

My form input name is "name" but table columns name is "project_name"

Flex left a reply on How To Validate (check) Data Table Values Befour Data Insert In Laravel 5.2 • 3 days ago

@Borisu generated this error

InvalidArgumentException in Validator.php line 3244:
Validation rule unique requires at least 1 parameters.

Flex started a new conversation How To Validate (check) Data Table Values Befour Data Insert In Laravel 5.2 • 3 days ago

I need validate and generate error message if same user try to insert existing project_name to the table in Laravel 5.2. My project table like this

user_id    project_name
    1          abc
    2          sdf
    3          kju

My project data store controller as follow

public function store(Request $request)
    {
        $this->validate($request, [
            'name'     => 'required|min:3'

        ]);

        $project = new Project;
        $project->project_name   = $request->input('name');
        $project->user_id        = Auth::user()->id;

        $project->save();

        return redirect()->route('projects.index')->with('info','Your Project has been created successfully');
    }

and I have alert.blade.php file as

@if ( session()->has('info'))
    <div class="alert alert-info" role-"alert">
        {{ session()->get('info') }}
    </div>
@endif

@if ( session()->has('warning'))
    <div class="alert alert-danger" role-"alert">
        {{ session()->get('warning') }}
    </div>
@endif

how can I fix this?

20th June, 2017

Flex left a reply on How To Fix Undefined Variable: Error • 5 days ago

@topvillas it generate following error

FatalErrorException in 85cf18ab02a958fb07f75d030d841fdd0d6c2a4b.php line 27: syntax error, unexpected 'else' (T_ELSE)

Flex started a new conversation How To Fix Undefined Variable: Error • 5 days ago

I got following error when run My laravel app

ErrorException in 85cf18ab02a958fb07f75d030d841fdd0d6c2a4b.php line 27:
Undefined variable: project (View: C:\Users\Flex\Desktop\santa\resources\views\names\index.blade.php)

this is My index.blade.php

@extends('layouts.app')
@section('content')
 
 <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    @include('layouts.partials.alerts')
    <h1 class="page-header">Projects<a class="btn btn-info" href="{{ route('projects.create') }}">New Project</a></h1>
 
    <div class="container">
      @if(isset($project))
          
         <div class="row">
             @foreach ($project as $proj)
               <div class="col-md-3" style="border:1px solid #ccc;margin-left:5px;">
               <h2><a href="/projects/{{ $proj->id }}">{!! $proj->project_name !!}</a></h2>
               <p>Due : {!! date_format(new DateTime($proj->due_date), "D, m Y") !!}</p>
               <p>Status: {!! $proj->project_status !!}</p>
               <p>Tasks: </p>
               <p>Comments: </p>
               <p>Attachments: </p>
               </div>
                
            @endforeach
         </div>
      @endif
      
      
    
       @if($project)->isEmpty()) // this is line 27
         <h3>There are currently no Projects</h3>
    @endif 
    </div>
    
    
    <br>
    

    <div class="container">
       <a class="btn btn-info" href="{{ route('projects.create') }}">New Project</a>
      
    </div>
    



</div>





@endsection

how to fix this?

19th June, 2017

Flex left a reply on How To Save Bootstrap Color Picker Values To Data Table • 6 days ago

@Mittensoff @shakti actually I need when I add this plugin to My laravel app and when I select new color and save it to table. I am not clear in this artical how to send new selected color code to table. I need clear it. Thanks!

Flex started a new conversation How To Save Bootstrap Color Picker Values To Data Table • 6 days ago

using bootstrap color picker plugin http://www.expertphp.in/article/simple-jquery-bootstrap-color-picker-plugin-example to store color values in My laravel app. I need how to grab color value to store when I select color from picker

 <input type="text" value="#00AABB" class="form-control" />

17th June, 2017

Flex left a reply on How To Add Date Picker Calender To Laravel App • 1 week ago

@ospira I need javascript or jquery one

16th June, 2017

Flex started a new conversation How To Add Date Picker Calender To Laravel App • 1 week ago

hi, I need add date picker (date selection calendar) to My Laravel app and save values to table. need start date and end date and sum of days between start and end days. please guide me for suitable tool or plugins. I need simple one

Flex left a reply on How To Use Bootstrap Datepicker In Laravel 5.2 • 1 week ago

I need dates calculations also between start date and end date...

Flex started a new conversation How To Use Bootstrap Datepicker In Laravel 5.2 • 1 week ago

I need use bootstrap datepicker start date and end date with dates counting in My Laravel app. (need save this data to database). please give me simple but good example links.

14th June, 2017

Flex left a reply on How To Integrate Bootstrap With Laravel • 1 week ago

@Snapey Yes it is working with jQuery line

13th June, 2017

Flex left a reply on How To Integrate Bootstrap With Laravel • 1 week ago

@Snapey here is some problem encountered you know that with laravel auth command here is logging form. then user can logging with username and user can see logout popup when click username. but in My case I couldn't see logot popup when comment this lines

  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js" integrity="sha384-I6F5OKECLVtK/BL+8iSLDEHowSAfUo76ZL9+kGAgTRdiByINKJaqTPH/QVNS1VDb" crossorigin="anonymous"></script> 

    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> 

currently I am using this one

<script src="{{ asset('js/bootstrap.min.js') }}"></script>

how can I solve this?

11th June, 2017

Flex left a reply on How To Integrate Bootstrap With Laravel • 2 weeks ago

@Snapey Thanks, it is working you comment what I need correctly

Flex left a reply on How To Integrate Bootstrap With Laravel • 2 weeks ago

@Snapey yes but it is loded via internet. I need direct install bootstrap files to My app.

Flex started a new conversation How To Integrate Bootstrap With Laravel • 2 weeks ago

hi, I need integrate bootstrap with My Laravel app. I do not use bootstrap theme only css and js files. currently using cdn via internet. I need exit cdn and download bootstrap files and paste it in public folder and connect with Laravel app. give me better solutions.

30th March, 2017

Flex left a reply on How To Create Edit.blade.php File For This Events • 2 months ago

@tisuchi tried your solutions but not working...

Flex started a new conversation How To Create Edit.blade.php File For This Events • 2 months ago

hellow I have following codes to store My data,

 public function store(PostFormRequest $request)
      {
        $bod = new Bod();
        $bod->id = $request->get('id');
        $bod->body = $request->get('body');
       
      
        $bod->save();
        return redirect('bod.edit'.$bod->body);->withMessage($message);
      }


this is My edit.blade.php

@extends('layouts.app1')

@section('title')
Edit Board of Directors
@endsection

@section('content')
<script type="text/javascript" src="{{ asset('/js/tinymce/tinymce.min.js') }}"></script>
<script type="text/javascript">
    tinymce.init({
        selector : "textarea",
        plugins : ["advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste jbimages"],
        toolbar : "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image jbimages"
    }); 
</script>

<form method="post" action='{{ url("/update") }}'>
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    <input type="hidden" name="post_id" value="{{ $post->id }}{{ old('post_id') }}">
    <div class="form-group">
        <input required="required" placeholder="Enter title here" type="text" name = "title" class="form-control" value="@if(!old('title')){{$post->title}}@endif{{ old('title') }}"/>
    </div>
    <div class="form-group">
        <textarea name='body'class="form-control">
            @if(!old('body'))
            {!! $post->body !!}
            @endif
            {!! old('body') !!}
        </textarea>
    </div>
    @if($post->active == '1')
    <input type="submit" name='publish' class="btn btn-success" value = "Update"/>
    @else
    <input type="submit" name='publish' class="btn btn-success" value = "Publish"/>
    @endif
    <input type="submit" name='save' class="btn btn-default" value = "Save As Draft" />
    <a href="{{  url('delete/'.$post->id.'?_token='.csrf_token()) }}" class="btn btn-danger">Delete</a>
</form>
@endsection

but now I need edit function to My Controller and not any idea about that. I need when I click save button-> redirect to edit with existing DB data in edit page

I allredy have written some thing but not pretty good...

   public function edit(Request $request)
      {
        $bod = Bod::where()->first();
        
          return view('posts.edit')->with('post',$post);
        }

19th March, 2017

Flex left a reply on TokenMismatchException In VerifyCsrfToken.php Line 67 • 3 months ago

solution is this

change PostFormRequest.php as

 public function authorize()
      {    
        
          return true;
       
      }

Flex left a reply on TokenMismatchException In VerifyCsrfToken.php Line 67 • 3 months ago

@tomi @SCC did it but now got this error "Forbidden"

Flex started a new conversation TokenMismatchException In VerifyCsrfToken.php Line 67 • 3 months ago

hi, got above error when I submit My form data.


    
    @extends('layouts.app1')

    @section('title')
    <h3>Board of Directors</h3>
    @endsection
    

    @section('content')
    

    <script type="text/javascript" src="{{ asset('/js/tinymce/tinymce.min.js') }}"></script>
<script type="text/javascript">
  tinymce.init({
    selector : "textarea",
    plugins : ["advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media table contextmenu paste"],
    toolbar : "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
  }); 
</script>

    <form action="/create" method="post">
  
   

      <div class="form-group">
      



        <textarea name='body'class="form-control">{{  old('body')  }}</textarea>
      </div>
      <input type="submit" name='publish' class="btn btn-success" value = "Publish"/>
      <input type="submit" name='save' class="btn btn-default" value = "Save Draft" />
    </form>
    @endsection

   
 
   
    

how can I fix this?

21st February, 2017

Flex started a new conversation How To Manage Both Blade Files In Layouts Folder? • 4 months ago

this is My routes

Route::auth();

Route::get('/', function () {
    return view('home');
});

Route::get('/content', [email protected]');

I need route My app to content.blade.php when I logged with the system. and when user visit site without logging the system (normal users) should route with home.blade.php but in my app it is allways redirect to home.blade.php although I visit as normal or logged user. how can solve this problem?

21st December, 2016

Flex left a reply on How To Upload Laravel Project In Webserver • 6 months ago

@SaeedPrez can you give me some good reference links?

Flex started a new conversation How To Upload Laravel Project In Webserver • 6 months ago

I need upload and check My Laravel project in free webserver like https://cpanel.hostinger.com. can you give me some tutorials sites or resources? I do not have database in the movement. then what about this in .env file?

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

9th December, 2016

Flex started a new conversation What Happened After Composer Update? • 6 months ago

Hi, I am using Laravel 5.2 and hope to update using composer update command. what happen after update. is it converted to 5.3 or some thing.....?

8th December, 2016

Flex left a reply on Where Should I Put My Laravel Join Scripts • 6 months ago

@phpMick actually I need where should I put joins commands?

Flex started a new conversation Where Should I Put My Laravel Join Scripts • 6 months ago

hey, I am not clear where should I put join codes in Laravel. is it in My Controller? and may I need relationship between tables?

1st December, 2016

Flex started a new conversation How To Select Current Value In Drop Down Menu • 6 months ago

I have some form with drop down menu selector. when I was selected some value and saved using drop down it was saved in table. but I when refresh drop down menu show default value(Choose a car). I need display I saved value My form is

  <select name="car" id="car">
                    <option value="">Choose a car</option>
                    <option value="3">BENZ</option>
                    <option value="2">BMW</option>
                    <option value="1">TOYOTA</option>
                    </select>

26th November, 2016

Flex started a new conversation Qutation For The Laravel Web Project • 6 months ago

I have some proposal to develop web project regarding tourism industry. web contain about 10 statics pages and dynamic part with CMS. can you suggest me some reasonable price to develop this system. I know that it is difficult to mention here about price without deep understand of the project but these are the main component system of the proposed site?

10 statics pages

login/register component

CMS (change some dynamic pages)

Thanks!

24th November, 2016

Flex left a reply on Working With Bootstap • 7 months ago

@frezno actully I do not need CDN. I need bootstrap on My files. Thanks!

Flex left a reply on Working With Bootstap • 7 months ago

@Jaytee I mean Twitter Bootstap dear. sorry for My mistakes.

Flex started a new conversation Working With Bootstap • 7 months ago

Need to know working bootstarp with Laravel 5. I am going to download bootstrap and install is to laravel. can I use this like hard code php? . what is the best way? how can I configure bootstarp with Laravel 5.

Edit Your Profile
Update

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