×ðÁú¿­Ê±¹ÙÍøµÇ¼

laravelÉèÖÃË÷Òý

Ëæ×Å»¥ÁªÍøÊÖÒյĿìËÙÉú³¤ £¬´ó×ÚµÄÊý¾ÝÒ»Ö±µÄ±»Éú²úºÍÀÛ»ý £¬ÔõÑù¸ßЧµÄÌáÈ¡Êý¾Ý¹ØÓÚÐí¶àÆóÒµºÍСÎÒ˽È˶øÑÔÖÁ¹ØÖ÷Òª¡£ÔÚmysqlÊý¾Ý¿âÖÐ £¬Ë÷ÒýÄܹ»×ÊÖúÎÒÃÇ¿ìËٵĶ¨Î»ºÍÅÌÎÊÊý¾Ý £¬Ìá¸ßÅÌÎÊЧÂÊ¡£±¾ÆªÎÄÕ½«ÏÈÈÝÔõÑùÔÚlaravel¿ò¼ÜÏÂÉèÖÃË÷Òý¡£

Ò»¡¢ÎªÊ²Ã´ÒªÉèÖÃË÷Òý

Ë÷ÒýÊÇÊý¾Ý¿âÖг£ÓõÄÒ»ÖÖÊý¾Ý½á¹¹ £¬Í¨¹ýÔÚ±íÖÐÌìÉúÒ»¸öË÷Òý £¬¿ÉÒÔÈÃÊý¾Ý¿â¸ü¿ìµØ²éÕÒÐèÒªµÄÊý¾Ý £¬Ìá¸ßÅÌÎʵÄЧÂÊ¡£ÔÚMySQLÊý¾Ý¿âÖÐ £¬Ã¿ÕÅ±í¶¼¿ÉÒÔÉèÖöà¸öË÷Òý £¬Ë÷Òý¿ÉÒÔÆðµ½ÀàËÆÓÚ×ÖµäµÄ×÷Óà £¬ÈÃÎÒÃÇ¿ÉÒÔ¸ü¿ìËÙµØÕÒµ½ÐèÒªµÄ¼Í¼¡£

µ±Êý¾Ý¿âÖеÄÊý¾ÝÁ¿½ÏÁ¿´óµÄʱ¼ä £¬ÈôÊÇûÓÐË÷Òý £¬Êý¾Ý¿â¾ÍÐèҪͨÅÌɨÃè £¬Õâ»á´øÀ´ºÜ´óµÄÐÔÄÜÎÊÌâ¡£¶øͨ¹ýÍŽáË÷ÒýºÍSQLÅÌÎÊ £¬¾Í¿ÉÒÔ¿ìËٵػñÈ¡ÐèÒªµÄÊý¾Ý £¬´ó´óïÔÌ­ÅÌÎʵÄʱ¼ä¡£

¶þ¡¢ÔÚLaravel¿ò¼ÜÏÂÉèÖÃË÷Òý

ÔÚLaravel¿ò¼ÜÏ £¬ÎÒÃÇ¿ÉÒÔʹÓúÏÊʵÄÒªÁìÀ´Îª±íÉèÖÃË÷Òý £¬³£ÓõÄÒªÁìÓÐÒÔÏÂÁ½ÖÖ£º

ʹÓÃǨáãÎļþ¾ÙÐÐË÷ÒýÉèÖÃ

ÔÚLaravel¿ò¼ÜÖÐ £¬ÎÒÃÇ¿ÉÒÔͨ¹ý±àдǨáãÎļþµÄ·½·¨À´¾ÙÐÐË÷ÒýµÄÉèÖá£ÏêϸµÄ°ì·¨ÈçÏ£º

Ê×ÏÈ £¬ÎÒÃÇÐèҪʹÓÃÒÔÏÂÏÂÁîÀ´½¨ÉèÒ»¸öÃûΪcreate_example_tableµÄǨáãÎļþ£º

php artisan make:migration create_example_table --create=example

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÔÚǨáãÎļþÖÐ £¬ÎÒÃÇÐèҪʹÓÃÒÔϵÄÓï¾äÀ´Îª±íÀý×ÓexampleÉèÖÃË÷Òý£º

public function up()
{
    Schema::create('example', function (Blueprint $table) {
        $table->id();
        $table->string('name');
        $table->string('email')->unique();
        $table->index(['name', 'email']);
    });
}

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊöµÄÓï¾äÖÐ £¬ÎÒÃÇʹÓÃÁËindexÒªÁìÀ´Îª±íÃûΪexampleµÄ±íÉèÖÃË÷Òý £¬Ë÷ÒýµÄ×Ö¶ÎΪnameºÍemail £¬ÕâÒâζ×ÅÎÒÃÇ¿ÉÒÔͨ¹ýÕâÁ½¸ö×Ö¶ÎÀ´¸ü¿ìµØÅÌÎÊÏà¹ØµÄÊý¾Ý¡£

ʹÓÃmigration-modules Composer°ü¾ÙÐÐË÷ÒýÉèÖÃ

³ýÁËʹÓÃLaravel¿ò¼ÜÔ­ÉúµÄÒªÁì¾ÙÐÐË÷ÒýÉèÖà £¬ÎÒÃÇÒ²¿ÉÒÔʹÓõÚÈý·½µÄComposer°üÀ´¾ÙÐÐÏàËƵIJÙ×÷¡£ÆäÖÐÒ»¸ö½ÏÁ¿ºÃµÄComposer°ü¾ÍÊÇmigration-modules¡£

ÔÚʹÓøÃComposer°ü֮ǰ £¬ÎÒÃÇÐèÒªÏÈÖ´ÐÐÒÔϵÄÓï¾ä¾ÙÐÐ×°Öãº

composer require webpress/migrations

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÎÒÃÇÐèҪʹÓÃÒÔϵÄÏÂÁîÀ´ÌìÉúÏìÓ¦µÄǨáãÎļþ£º

php artisan migrations:generate --indexes example

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊöµÄÓï¾äÖÐ £¬example´ú±íÎÒÃÇÐèҪΪÃûΪexampleµÄ±íÉèÖÃË÷Òý¡£ÔËÐÐÕâÌõÏÂÁîºó £¬migration-modules»á×Ô¶¯½¨ÉèÏìÓ¦µÄǨáãÎļþ £¬ÎļþÖлá×Ô¶¯ÎªÎÒÃÇÉèÖÃÏìÓ¦µÄË÷Òý¡£

Èý¡¢ÔõÑùÓÅ»¯Ë÷ÒýЧÂÊ

ËäÈ»Ë÷Òý¿ÉÒÔÌá¸ßÊý¾Ý¿âÅÌÎʵÄËÙÂÊ £¬µ«²»Êʵ±µÄË÷ÒýÉèÖÃÒ²»á¶ÔÅÌÎÊÐÔÄÜÔì³É²»Á¼Ó°Ïì¡£Òò´Ë £¬ÎÒÃÇÐèÒªºÏÀíµØÉèÖÃË÷Òý £¬ÒÔÌá¸ßÅÌÎÊЧÂʺÍÓÅ»¯ÐÔÄÜ¡£

ÒÔÏÂÊǼ¸¸ö³£¼ûµÄÓÅ»¯Ë÷ÒýЧÂʵÄÒªÁ죺

×èֹʹÓùý¶àµÄË÷Òý

ËäÈ»Ë÷Òý¿ÉÒÔÌá¸ßÅÌÎÊЧÂÊ £¬µ«ÈôÊÇÉèÖùý¶àµÄË÷Òý½«»áʹÅÌÎʱäµÃÔ½·¢»ºÂý £¬ÓÉÓÚÿ¸öË÷Òý¶¼ÐèÒªÕ¼ÓÃÒ»¶¨µÄ¿Õ¼ä²¢ÇÒÐèÒª¸üС£Òò´Ë £¬ÎÒÃÇÐèÒª×èֹʹÓùý¶àµÄË÷Òý £¬Ö»Ñ¡ÔñÐëÒªµÄ×Ö¶Î×÷ΪË÷Òý £¬ÒÔÌá¸ßÅÌÎÊЧÂÊ¡£

ʹÓÃÖ¸¶¨ÀàÐ͵ÄË÷Òý

ÔÚMySQLÊý¾Ý¿âÖÐ £¬Ë÷ÒýÓвî±ðµÄÀàÐÍ £¬ÈçB-Tree¡¢HASHºÍFULLTEXTµÈ¡£B-TreeÊÇMySQLĬÈϵÄË÷ÒýËã·¨ £¬Ò²ÊÇʹÓÃ×îÆÕ±éµÄÒ»ÖÖËã·¨¡£µ«µ±ÐèÒª¶ÔÎı¾¾ÙÐÐÈ«ÎÄËÑË÷ʱ £¬ÎÒÃÇÐèҪʹÓÃFULLTEXTÀàÐ͵ÄË÷Òý¡£

ÔöÌíÅþÁ¬ÅÌÎÊÖÐË÷ÒýµÄЧÂÊ

ÔÚÁ¬±íÅÌÎʵÄÇéÐÎÏ £¬ÎªÁËÌá¸ßÅÌÎÊЧÂÊ £¬ÎÒÃÇÐèÒªÔÚÅþÁ¬Ìõ¼þµÄ×Ö¶ÎÉϽ¨ÉèË÷Òý¡£Õâ¿ÉÒÔïÔÌ­JOIN²Ù×÷µÄ´ÎÊý £¬´Ó¶øÌá¸ßÅÌÎÊЧÂÊ¡£

ËÄ¡¢×ܽá

ÉèÖÃË÷ÒýÊÇÒ»¸ö»ù´¡²¢ÇÒÊ®·ÖÖ÷ÒªµÄʹÃü £¬Ëü¿ÉÒÔÌá¸ßMySQLÊý¾Ý¿âµÄÅÌÎÊЧÂʺÍÐÔÄÜ¡£ÔÚLaravel¿ò¼ÜÏ £¬ÎÒÃÇ¿ÉÒÔʹÓÃǨáãÎļþºÍµÚÈý·½Composer°üÀ´¾ÙÐÐË÷ÒýµÄÉèÖᣲ»¹ý £¬ÈôÊDz»¶ÔÀíµÄÉèÖÃË÷Òý £¬·´¶ø»áµ¼ÖÂÐÔÄÜÎÊÌâ¡£Òò´Ë £¬ÎÒÃÇÐèÒª×ñÕÕºÏÊʵÄË÷ÒýÉèÖÃÔ­ÔòÀ´ÓÅ»¯Ë÷ÒýЧÂÊ¡£

ÒÔÉϾÍÊÇlaravelÉèÖÃË÷ÒýµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ