<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                1、列出所有可用命令 ~~~ php artisan list ~~~ 2、查看某個命令的幫助,可以使用`help`或`-h` ~~~ php artisan help migrate ~~~ 或 ~~~ php artisan migrate -h ~~~ 3、指定環境配置 ~~~ php artisan migrate --env=local ~~~ 4、查看當前laravel的版本 ~~~ php artisan --version ~~~ 或 ~~~ php artisan -V ~~~ 一.artisan命令 1.php artisan list //查看所有的artisan命令 2.php artisan help 命令 //查看指定命令的幫助,也可以這樣用 php artisan 命令 --help或php artisan 命令 --h 3.php artisan --v 或 php artisan -V //查看當前安裝的laravel版本 4.php artisan migrate --env=local //使用指定的環境配置,需要在執行命令時加上 --env即可切換 1.php artisan make:controller PagesController php artisan make:controller PagesController --resource 2.php artisan make:controller PagesController --hplp 3.php artisan make:controller PagesController --plain 4.php artisan fresh 5.php artisan migrate:rollback 6.php artisan make:migration create_articles_table --create="articles" 7.php artisan make:migration add_excerpt_to_articles_table 8.php artisan make:migration add_excerpt_to_articles_table --table="articles" 10.php artisan make:model Article -m (加-m參數會附加創建遷移文件) 11.php artisan tinker 12.php artisan make:controller ArticlesController --plain $article=new App\Article(); $article->published_at=Carbon\Carbon::now(); $article->toArray(); $article->toJson(); $article->save(); App\Article::all()->toArray(); App\Article::find(1); App\Article::where('body','Lorem ipsum')->get();//都是select,但返回的對象不同 App\Article::where('body','Lorem ipsum')->first();//都是select,但返回的對象不同 $article->body; $article=App\Article::create(['title'=>'New Article','body'=>'New body','published_at'=>Carbon\Carbon::now()]); $article=App\Article::find(2); $article->update(['body'=>'Updated Again']); protected $fillable=[ 'title', 'body', 'published_at' ] $article=Article::findOrFail($id); $article=Article::find($id); $article=Article::latest('published_at')->get(); $article=Article::order_by('published_at')->get(); 在phpstorm中,輸入 ! 然后 tab鍵,就能自動填充 html代碼 1.<?= $name; ?> 2.{{ $name }} 3.{!! $name !!} touch storage/database.sqlite $table->dropColumn('excerpt'); composer require illuminate/html //安裝html模塊 composer remove illuminate/html //移除html模塊 1.php artisan help 2.php artisan list 3.php artisan make:model Article 4.php artisan migrate; 5.php artisan migrate:rollback; 6.composer dump-autoload 7.php artisan db:seed 8.php artisan route:list 9.php artisan migrate:rollback 10.php artisan tinker --help Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){ Route::get('/','AdminHomeController@index'); }); $table->increments('id'); $table->string('name'); $table->string('email', 64); $table->char('char', 64); $table->string('email')->unique(); $table->string('image')->nullable(); $table->text('body')->nullable(); $table->integer('user_id'); $table->boolean('active')->default(1); $table->integer('role_id')->unsigned(); ``` $table->string('password',32) ->deafault('')//默認值 ->comment('密碼');//注釋 $table->integer('created_at') ->default('0') ->unsigned(); $table->integer('updated_at')->unsigned(); ``` $table->rememberToken(); $table ->dropColumn('email'); get('/','IndexController@index')==Route::get('/','IndexController@index') dd(); php artisan tinker DB::table('songs')->insert(['title'=>'As Long As You Love Me']); DB::table('songs')->get(); DB::table('songs')->find(['id'=>1]); $song=new App\Song; $song->title="As Long As You Love Me"; $song->slug="as long as you love me"; $song->toArray(); $song->save(); $song->all(); $song->all()->toArray(); $song->all()->toJson(); Song::whereSlug($slug)->first(); Route::model('song','App\Song'); Route::bind('song',function($slug){ //return App\Song::whereSlug($slug)->first(); return App\Song::where('slug',$slug)->first(); }); compose require illuminate/html {!! Form::open() !!} {!! Form::close() !!} {!! Form::text('title') !!} {!! Form::text('title',null,['class'=>'form-control']) !!} {!! Form::textarea('lyrics',null,['class'=>'form-control']) !!} {!! Form::submit('Update Song',['class'=>'btn btn-primary']) !!} {!! Form::model($song,['url'=>'http://www.baidu.com','method'=>'post']) !!} dd(\Request::input()); dd(\Request::all()); redirect('songs'); $song->fill(['title'=>$request->get('title')])->save(); protected $fillable=['title','lyrics']; $router->get('songs','SongsController@index'); php artisan route:list $router->resource('songs','SongsController'); $router->resource('songs','SongsController',[ //'only'=>['index','show','edit','update'], 'except'=>['create'] ]); route('song_path',['$song->title']); {!! link_to_route('song_path',$song->title,[$song->title]) !!} {!! link_to_route('show.index',$song->title,[$song->title]) !!} {!! Form::model($song,['route'=>['songs.update',$song->title],'method'=>'PATCH']) !!} @include('songs.form') php artisan | grep make {{$errors->has('title') ? 'has-error' : ''}} {!! $errors->first('title','<span class="help-block">:message</span>') !!} php artisan make:seeder StudentTableSeeder php artisan db:seed --class=StudentTableSeeder laravel 自定義函數 可以寫在routes.php里,這樣可以自動加載,但是這不是標準的做法 應該寫在一個獨立的php文件里,然后通過配置conposer.json這個文件,達到自動加載的效果 步驟: 1.在app/Http下建立helper.php(當然也可以命名為其他名字),把函數寫在這個文件里 2.打開conposer.json,找到 "psr-4": { "App\\": "app/" }這一項,在下面添加,如下些所示 "files":["app/Http/helper.php"] 3.然后在命令行模式下,運行 composer dump-autoload 命令刷新配置項 這樣就可以了
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看