- создание модели с именем Модель
-m создание файла миграции
php artisan make:model Модель -m
app\Models\Модель.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Модель extends Model{
...
}
php artisan make:model Модель -m
app\Models\Модель.php
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Модель extends Model{
...
}
<template>
<div>test</div>
</template>
require('./bootstrap');
import {createApp} from 'vue';
import MyTest from './components/MyTest.vue';
const app=createApp({});
app.component('my-test',MyTest);
app.mount('#app');
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="app">
<my-test/>
</div>
<script src="./js/app.js"></script>
</body>
</html>
...
Route::get('/', function () {
return view('index');
});
...
const mix = require('laravel-mix');
const path = require('path');
mix.webpackConfig({
resolve: {
alias: {
'components':path.resolve(__dirname,'resources/components/')
},
},
});
любой файл, связанный с vue
../Project/resources/components/dir1/dir2/comp.js
import comp from 'root/dir1/dir2/comp';
../Project/resources/components/dir1/dir2/comp.vue
import comp from 'root/dir1/dir2/comp.vue';