Thursday, June 22, 2017

Laravel 5.4+ (Important Note)



  • Laravel utilizes Composer to manage its dependencies. So, before using Laravel, make sure you have Composer installed on your machine. https://getcomposer.org/
  • Via Composer Create-Project, command in your terminal:    
        composer  create-project --prefer-dist laravel/laravel Project_name

  • check your php installed version
php -v



  • All command are available
php artisan
  • make a controller

                php artisan make:controller ControllerName
  • link in design folder
               {{asset('public/FrontEnd/css/bootstrap.css')}}
  • include section
@include('FrontEnd.include.header')
  • include dynamic area
@yield('mainContain')

we use yield when we use this

@section("mainContain")
@endsection()
  • href="{{url('/category')}}"
  • @extends('frontEnd.master')
  • Basic login and registration views and routes 
       php artisan make:auth
  • Create Migration 
       php artisan make:migration create_users_table --create=users
  • migrate    
       php artisan migrate
  • after update migrate file                      
php artisan migrate:refresh
  • vendor  login best
  • database name add
goto .env file and add database name,passsword,
  • model and migrate file
php artisan make:model Category -m
  • all method return ll value
return $request->all(); 
  • if else in blade template short cut
{{$userInfoById->gender =='female' ? 'checked':'' }}
  • php artisan serve

  • Reformatting the code of a directory

  1. press Ctrl+Alt+L.
  2.  Reformat Code in Phpstrome
  • php artisan db:seed
  • pull-right (Bootstrap)
  •    
<!-- @if (count($errors) > 0) <div class="alert alert-danger"> <ul> @foreach ($errors->all() as $error) <li>{{ $error }}</li> @endforeach </ul> </div> @endif

  • npm run watch
php artisan make:controller shadhinController --resource
Route::resource('store','shadhinController');

{{Form::open(['url'=>'store/abcd','method'=>'POST'])}}
                    {{method_field('PUT')}}
                    {{ Form::text('username',$value=null,['class'=>'form-control','placeholder'=>'enter your name']) }}
                    {{Form::select('size', ['L' => 'Large', 'S' => 'Small'])}}
                    {{Form::file('image')}}
                    <br>
                    {{ Form::checkbox('chk', 'Remember Me')}} Remember Me
                    {{ Form::submit('Login',['class'=>'btn btn-success btn-block','name'=>'btn']) }}
                    {!! Form::close() !!}





No comments:

Post a Comment